You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2009/09/21 12:48:19 UTC

svn commit: r817200 - in /myfaces/core/trunk/api/src/main/java/javax/faces/event: PostConstructCustomScopeEvent.java PreDestroyCustomScopeEvent.java ScopeContext.java

Author: werpu
Date: Mon Sep 21 10:48:17 2009
New Revision: 817200

URL: http://svn.apache.org/viewvc?rev=817200&view=rev
Log:
https://issues.apache.org/jira/browse/MYFACES-2358

Adding missing System Events which were stated by the spec javadocs!
Added the missing scope context.




Added:
    myfaces/core/trunk/api/src/main/java/javax/faces/event/PostConstructCustomScopeEvent.java
    myfaces/core/trunk/api/src/main/java/javax/faces/event/PreDestroyCustomScopeEvent.java
    myfaces/core/trunk/api/src/main/java/javax/faces/event/ScopeContext.java

Added: myfaces/core/trunk/api/src/main/java/javax/faces/event/PostConstructCustomScopeEvent.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/event/PostConstructCustomScopeEvent.java?rev=817200&view=auto
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/event/PostConstructCustomScopeEvent.java (added)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/event/PostConstructCustomScopeEvent.java Mon Sep 21 10:48:17 2009
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package javax.faces.event;
+
+/**
+ * A system event which is dispatched after the construction
+ * of a custom scope
+ *
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ *
+ * @since 2.0
+ */
+
+public class PostConstructCustomScopeEvent extends SystemEvent {
+    public PostConstructCustomScopeEvent(ScopeContext source) {
+        super(source);
+    }
+
+    /**
+     * @return the source as scope context representation for this event
+     */
+    public ScopeContext getScope() {
+        return (ScopeContext) source;
+    }
+}

Added: myfaces/core/trunk/api/src/main/java/javax/faces/event/PreDestroyCustomScopeEvent.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/event/PreDestroyCustomScopeEvent.java?rev=817200&view=auto
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/event/PreDestroyCustomScopeEvent.java (added)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/event/PreDestroyCustomScopeEvent.java Mon Sep 21 10:48:17 2009
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package javax.faces.event;
+
+/**
+ * A system event which is dispathed prior to the destruction of a custom scope
+ *
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public class PreDestroyCustomScopeEvent extends SystemEvent  {
+    
+    public PreDestroyCustomScopeEvent(ScopeContext source) {
+        super(source);
+    }
+
+    /**
+     * @return the source as scope context representation for this event
+     */
+    public ScopeContext getScope() {
+        return (ScopeContext) source;
+    }
+}

Added: myfaces/core/trunk/api/src/main/java/javax/faces/event/ScopeContext.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/event/ScopeContext.java?rev=817200&view=auto
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/event/ScopeContext.java (added)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/event/ScopeContext.java Mon Sep 21 10:48:17 2009
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package javax.faces.event;
+
+import java.util.Map;
+
+/**
+ * A context for scope data
+ *
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ * @since 2.0
+ */
+
+public class ScopeContext {
+
+    String _scopeName;
+    Map<String, Object> _scope;
+
+    public ScopeContext(String scopeName, Map<String, Object> scope) {
+        _scopeName = scopeName;
+        _scope = scope;
+    }
+
+    /**
+     * @return the scope name stored in the context
+     */
+    public String getScopeName() {
+        return _scopeName;
+    }
+
+    /**
+     * @return the scope data
+     */
+    public Map<String, Object> getScope() {
+        return _scope;
+    }
+}