Author: ash2k
Date: Sun Jun 29 05:52:06 2014
New Revision: 1606431

URL: http://svn.apache.org/r1606431
Log:
ONAMI-102 Support for JSR-250

Added:
    onami/trunk/lifecycle/jsr250/
    onami/trunk/lifecycle/jsr250/pom.xml
    onami/trunk/lifecycle/jsr250/src/
    onami/trunk/lifecycle/jsr250/src/main/
    onami/trunk/lifecycle/jsr250/src/main/java/
    onami/trunk/lifecycle/jsr250/src/main/java/org/
    onami/trunk/lifecycle/jsr250/src/main/java/org/apache/
    onami/trunk/lifecycle/jsr250/src/main/java/org/apache/onami/
    onami/trunk/lifecycle/jsr250/src/main/java/org/apache/onami/lifecycle/
    
onami/trunk/lifecycle/jsr250/src/main/java/org/apache/onami/lifecycle/jsr250/
    
onami/trunk/lifecycle/jsr250/src/main/java/org/apache/onami/lifecycle/jsr250/PostConstructModule.java
    
onami/trunk/lifecycle/jsr250/src/main/java/org/apache/onami/lifecycle/jsr250/PreDestroyModule.java
Modified:
    onami/trunk/lifecycle/pom.xml

Added: onami/trunk/lifecycle/jsr250/pom.xml
URL: 
http://svn.apache.org/viewvc/onami/trunk/lifecycle/jsr250/pom.xml?rev=1606431&view=auto
==============================================================================
--- onami/trunk/lifecycle/jsr250/pom.xml (added)
+++ onami/trunk/lifecycle/jsr250/pom.xml Sun Jun 29 05:52:06 2014
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ | 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.onami.lifecycle</groupId>
+    <artifactId>org.apache.onami.lifecycle.parent</artifactId>
+    <version>0.2.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>org.apache.onami.lifecycle.jsr250</artifactId>
+
+  <name>Apache Onami-Lifecycle JSR-250</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>org.apache.onami.lifecycle.core</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+  </dependencies>
+
+</project>

Added: 
onami/trunk/lifecycle/jsr250/src/main/java/org/apache/onami/lifecycle/jsr250/PostConstructModule.java
URL: 
http://svn.apache.org/viewvc/onami/trunk/lifecycle/jsr250/src/main/java/org/apache/onami/lifecycle/jsr250/PostConstructModule.java?rev=1606431&view=auto
==============================================================================
--- 
onami/trunk/lifecycle/jsr250/src/main/java/org/apache/onami/lifecycle/jsr250/PostConstructModule.java
 (added)
+++ 
onami/trunk/lifecycle/jsr250/src/main/java/org/apache/onami/lifecycle/jsr250/PostConstructModule.java
 Sun Jun 29 05:52:06 2014
@@ -0,0 +1,41 @@
+package org.apache.onami.lifecycle.jsr250;
+
+/*
+ * 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.
+ */
+
+import org.apache.onami.lifecycle.core.LifeCycleModule;
+
+import javax.annotation.PostConstruct;
+
+/**
+ * Guice module to register methods to be invoked after injection is complete.
+ *
+ * @author Mikhail Mazursky
+ */
+public class PostConstructModule
+    extends LifeCycleModule
+{
+
+    @Override
+    protected void configure()
+    {
+        bindLifeCycle( PostConstruct.class );
+    }
+
+}

Added: 
onami/trunk/lifecycle/jsr250/src/main/java/org/apache/onami/lifecycle/jsr250/PreDestroyModule.java
URL: 
http://svn.apache.org/viewvc/onami/trunk/lifecycle/jsr250/src/main/java/org/apache/onami/lifecycle/jsr250/PreDestroyModule.java?rev=1606431&view=auto
==============================================================================
--- 
onami/trunk/lifecycle/jsr250/src/main/java/org/apache/onami/lifecycle/jsr250/PreDestroyModule.java
 (added)
+++ 
onami/trunk/lifecycle/jsr250/src/main/java/org/apache/onami/lifecycle/jsr250/PreDestroyModule.java
 Sun Jun 29 05:52:06 2014
@@ -0,0 +1,53 @@
+package org.apache.onami.lifecycle.jsr250;
+
+/*
+ * 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.
+ */
+
+import org.apache.onami.lifecycle.core.DefaultStager;
+import org.apache.onami.lifecycle.core.LifeCycleStageModule;
+import org.apache.onami.lifecycle.core.Stager;
+
+import javax.annotation.PreDestroy;
+
+/**
+ * Guice module to register methods to be invoked when {@link 
org.apache.onami.lifecycle.core.Stager#stage()} is invoked.
+ * <p/>
+ * Module instance have state so it must not be used to construct more than 
one {@link com.google.inject.Injector}.
+ *
+ * @author Mikhail Mazursky
+ */
+public class PreDestroyModule
+    extends LifeCycleStageModule
+{
+
+    private final Stager<PreDestroy> stager = new DefaultStager<PreDestroy>(
+        PreDestroy.class, DefaultStager.Order.FIRST_IN_LAST_OUT );
+
+    @Override
+    protected void configureBindings()
+    {
+        bindStager( stager );
+    }
+
+    public Stager<PreDestroy> getStager()
+    {
+        return stager;
+    }
+
+}

Modified: onami/trunk/lifecycle/pom.xml
URL: 
http://svn.apache.org/viewvc/onami/trunk/lifecycle/pom.xml?rev=1606431&r1=1606430&r2=1606431&view=diff
==============================================================================
--- onami/trunk/lifecycle/pom.xml (original)
+++ onami/trunk/lifecycle/pom.xml Sun Jun 29 05:52:06 2014
@@ -39,6 +39,7 @@
   <modules>
     <module>core</module>
     <module>standard</module>
+    <module>jsr250</module>
     <module>warmup</module>
   </modules>
 


Reply via email to