https://issues.apache.org/jira/browse/EXTSCRIPT-157: Save current state of affairs before rerelease,
the release notes will be adjusted accordingly.
git-svn-id: https://svn.apache.org/repos/asf/myfaces/extensions/scripting/trunk@1305237 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/WeavingContext.java b/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/WeavingContext.java
index 713b9bf..2bbe122 100644
--- a/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/WeavingContext.java
+++ b/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/WeavingContext.java
@@ -19,6 +19,8 @@
package org.apache.myfaces.extensions.scripting.core.api;
+import org.apache.myfaces.extensions.scripting.core.api.events.WeavingEvent;
+import org.apache.myfaces.extensions.scripting.core.api.events.WeavingEventListener;
import org.apache.myfaces.extensions.scripting.core.common.util.ClassUtils;
import org.apache.myfaces.extensions.scripting.core.common.util.ReflectUtil;
import org.apache.myfaces.extensions.scripting.core.engine.FactoryEngines;
@@ -85,6 +87,8 @@
*/
ConcurrentHashMap<String, Long> lifecycleRegistry = new ConcurrentHashMap<String, Long>();
+ WeakHashMap<WeavingEventListener, String> _listeners = new WeakHashMap<WeavingEventListener, String>();
+
/**
* This is a log which keeps track of the taints
* over time, we need that mostly for bean refreshes
@@ -133,6 +137,21 @@
}
}
+
+ public void addListener(WeavingEventListener listener) {
+ _listeners.put(listener,"");
+ }
+
+ public void removeListener(WeavingEventListener listener) {
+ _listeners.remove(listener);
+ }
+
+ public void sendWeavingEvent(WeavingEvent evt) {
+ for(WeavingEventListener listener: _listeners.keySet()) {
+ listener.onEvent(evt);
+ }
+ }
+
public void initEngines() throws IOException
{
FactoryEngines.getInstance().init();
diff --git a/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/events/BeginCompiling.java b/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/events/BeginCompiling.java
new file mode 100644
index 0000000..8149892
--- /dev/null
+++ b/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/events/BeginCompiling.java
@@ -0,0 +1,29 @@
+/*
+ * 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 org.apache.myfaces.extensions.scripting.core.api.events;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+@WeavingEvent
+public class BeginCompiling
+{
+}
diff --git a/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/events/BeginLifecycle.java b/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/events/BeginLifecycle.java
new file mode 100644
index 0000000..4f5a745
--- /dev/null
+++ b/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/events/BeginLifecycle.java
@@ -0,0 +1,29 @@
+/*
+ * 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 org.apache.myfaces.extensions.scripting.core.api.events;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+@WeavingEvent
+public class BeginLifecycle
+{
+}
diff --git a/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/events/ClassReloadedEvent.java b/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/events/ClassReloadedEvent.java
new file mode 100644
index 0000000..7aa89de
--- /dev/null
+++ b/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/events/ClassReloadedEvent.java
@@ -0,0 +1,29 @@
+/*
+ * 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 org.apache.myfaces.extensions.scripting.core.api.events;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+@WeavingEvent
+public class ClassReloadedEvent
+{
+}
diff --git a/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/events/EndCompiling.java b/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/events/EndCompiling.java
new file mode 100644
index 0000000..56f57fd
--- /dev/null
+++ b/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/events/EndCompiling.java
@@ -0,0 +1,29 @@
+/*
+ * 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 org.apache.myfaces.extensions.scripting.core.api.events;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+@WeavingEvent
+public class EndCompiling
+{
+}
diff --git a/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/events/EndLifecycle.java b/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/events/EndLifecycle.java
new file mode 100644
index 0000000..483237d
--- /dev/null
+++ b/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/events/EndLifecycle.java
@@ -0,0 +1,29 @@
+/*
+ * 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 org.apache.myfaces.extensions.scripting.core.api.events;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+@WeavingEvent
+public class EndLifecycle
+{
+}
diff --git a/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/events/TaintedEvent.java b/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/events/TaintedEvent.java
new file mode 100644
index 0000000..e942888
--- /dev/null
+++ b/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/events/TaintedEvent.java
@@ -0,0 +1,53 @@
+/*
+ * 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 org.apache.myfaces.extensions.scripting.core.api.events;
+
+import org.apache.myfaces.extensions.scripting.core.monitor.ClassResource;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ *
+ * event which is fired if a class resource is tainted
+ */
+@WeavingEvent
+public class TaintedEvent
+{
+ ClassResource resource;
+
+ public TaintedEvent()
+ {
+ }
+
+ public TaintedEvent(ClassResource resource)
+ {
+ this.resource = resource;
+ }
+
+ public ClassResource getResource()
+ {
+ return resource;
+ }
+
+ public void setResource(ClassResource resource)
+ {
+ this.resource = resource;
+ }
+}
diff --git a/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/events/WeavingEvent.java b/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/events/WeavingEvent.java
new file mode 100644
index 0000000..e51f741
--- /dev/null
+++ b/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/events/WeavingEvent.java
@@ -0,0 +1,35 @@
+/*
+ * 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 org.apache.myfaces.extensions.scripting.core.api.events;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+public @interface WeavingEvent
+{
+}
diff --git a/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/events/WeavingEventListener.java b/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/events/WeavingEventListener.java
new file mode 100644
index 0000000..ee85604
--- /dev/null
+++ b/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/events/WeavingEventListener.java
@@ -0,0 +1,30 @@
+/*
+ * 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 org.apache.myfaces.extensions.scripting.core.api.events;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+public interface WeavingEventListener
+{
+ public void onEvent(WeavingEvent evt);
+}
diff --git a/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/events/readme.txt b/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/events/readme.txt
new file mode 100644
index 0000000..f5cf46b
--- /dev/null
+++ b/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/api/events/readme.txt
@@ -0,0 +1,2 @@
+a set of application state events which will be utilized further on by other subsystems than jsf (which utilizes a
+servlet state)
diff --git a/pom.xml b/pom.xml
index 70e2532..85e24f2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,7 +27,7 @@
<!-- test -->
<properties>
<myfaces12.version>1.2.9</myfaces12.version>
- <myfaces2.version>2.0.12-SNAPSHOT</myfaces2.version>
+ <myfaces2.version>2.1.7-SNAPSHOT</myfaces2.version>
<extval.version>2.0.5</extval.version>
<groovy.version>1.7.2</groovy.version>
<maven-scala-plugin.scalaVersion>2.15.2</maven-scala-plugin.scalaVersion>