geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1022792 - in /geronimo/specs/trunk/geronimo-availability_1.0_spec: ./ src/main/java/javax/availability/management/
Date Fri, 15 Oct 2010 00:47:07 GMT
Author: adc
Date: Fri Oct 15 00:47:06 2010
New Revision: 1022792

URL: http://svn.apache.org/viewvc?rev=1022792&view=rev
Log:
GERONIMO-5645 updated API

Modified:
    geronimo/specs/trunk/geronimo-availability_1.0_spec/pom.xml
    geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/ActivationReason.java
    geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityAgent.java
    geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityAgentFactory.java
    geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityAgentService.java
    geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityContainerController.java
    geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityException.java
    geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityService.java
    geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityUnitController.java
    geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/DeactivationReason.java
    geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/HealthCheck.java

Modified: geronimo/specs/trunk/geronimo-availability_1.0_spec/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-availability_1.0_spec/pom.xml?rev=1022792&r1=1022791&r2=1022792&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-availability_1.0_spec/pom.xml (original)
+++ geronimo/specs/trunk/geronimo-availability_1.0_spec/pom.xml Fri Oct 15 00:47:06 2010
@@ -31,12 +31,12 @@
     </parent>
 
     <groupId>org.apache.geronimo.specs</groupId>
-    <artifactId>geronimo-availability_0.4_spec</artifactId>
+    <artifactId>geronimo-availability_1.0_spec</artifactId>
     <packaging>bundle</packaging>
-    <name>Apache Geronimo Availability Management for Java 0.4</name>
+    <name>Apache Geronimo Availability Management for Java 1.0</name>
     <version>1.0-SNAPSHOT</version>
 
-    <description>Availability JSR ??? API</description>
+    <description>JSR 319: Availability Management for Java</description>
 
     <url>http://geronimo.apache.org/maven/${siteId}/${version}</url>
     <distributionManagement>
@@ -51,9 +51,9 @@
     </properties>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/geronimo/specs/trunk/geronimo-availability_0.4_spec/</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/geronimo/specs/trunk/geronimo-availability_0.4_spec/</developerConnection>
-        <url>http://svn.apache.org/viewcvs.cgi/geronimo/specs/trunk/geronimo-availability_0.4_spec/</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/geronimo/specs/trunk/geronimo-availability_1.0_spec/</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/geronimo/specs/trunk/geronimo-availability_1.0_spec/</developerConnection>
+        <url>http://svn.apache.org/viewcvs.cgi/geronimo/specs/trunk/geronimo-availability_1.0_spec/</url>
     </scm>
 
     <build>
@@ -63,7 +63,7 @@
             <artifactId>maven-bundle-plugin</artifactId>
             <configuration>
                 <instructions>
-                  <Export-Package>javax.availability.management*;version=0.4</Export-Package>
+                  <Export-Package>javax.availability.management*;version=1.0</Export-Package>
                 </instructions>
             </configuration>
         </plugin>

Modified: geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/ActivationReason.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/ActivationReason.java?rev=1022792&r1=1022791&r2=1022792&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/ActivationReason.java
(original)
+++ geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/ActivationReason.java
Fri Oct 15 00:47:06 2010
@@ -17,13 +17,15 @@
  */
 package javax.availability.management;
 
+import java.io.Serializable;
+
+
 /**
  * @version $Rev$ $Date$
  */
-public enum ActivationReason {
+public enum ActivationReason implements Serializable, Comparable<ActivationReason>
{
 
     START_UP,
     FAIL_OVER,
-    SWITCH_OVER,
-    UPGRADE
+    SWITCH_OVER
 }

Modified: geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityAgent.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityAgent.java?rev=1022792&r1=1022791&r2=1022792&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityAgent.java
(original)
+++ geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityAgent.java
Fri Oct 15 00:47:06 2010
@@ -17,6 +17,7 @@
  */
 package javax.availability.management;
 
+import java.util.Properties;
 import java.util.concurrent.ExecutorService;
 
 
@@ -27,5 +28,7 @@ public interface AvailabilityAgent {
 
     void init(AvailabilityContainerController container, ExecutorService executor) throws
AvailabilityException;
 
+    void init(AvailabilityContainerController container, ExecutorService executor, Properties
properties) throws AvailabilityException;
+
     void terminate() throws AvailabilityException;
 }

Modified: geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityAgentFactory.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityAgentFactory.java?rev=1022792&r1=1022791&r2=1022792&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityAgentFactory.java
(original)
+++ geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityAgentFactory.java
Fri Oct 15 00:47:06 2010
@@ -17,27 +17,38 @@
  */
 package javax.availability.management;
 
+import java.util.Properties;
+
+
 /**
  * @version $Rev$ $Date$
  */
 public class AvailabilityAgentFactory {
 
     private static final Object LOCK = new Object();
-    private static AvailabilityAgent agent;
+    private static AvailabilityAgent AGENT;
 
     public static synchronized AvailabilityAgent instantiateAvailabilityAgent() throws AvailabilityException
{
 
+        return instantiateAvailabilityAgent(null);
+    }
+
+    public static AvailabilityAgent instantiateAvailabilityAgent(Properties properties) throws
AvailabilityException {
+
+        if (properties == null) properties = new Properties();
+
         synchronized (LOCK) {
 
-            if (agent != null) return agent;
+            if (AGENT != null) return AGENT;
 
-            String agentClassName = System.getProperty("javax.availability.management.agent");
+            String agentClassName = properties.getProperty("javax.availability.management.agent");
+            if (agentClassName == null) agentClassName = System.getProperty("javax.availability.management.agent");
 
             if (agentClassName == null) throw new AvailabilityException("javax.availability.management.agent
has not been set");
 
             try {
                 Class<?> agentClass = Class.forName(agentClassName);
-                agent = (AvailabilityAgent) agentClass.newInstance();
+                AGENT = (AvailabilityAgent) agentClass.newInstance();
             } catch (ClassNotFoundException cnfe) {
                 throw new AvailabilityException("Unable to locate class " + agentClassName,
cnfe);
             } catch (InstantiationException ie) {
@@ -48,7 +59,7 @@ public class AvailabilityAgentFactory {
                 throw new AvailabilityException("The class " + agentClassName + " does not
implement AvailabilityAgent", cce);
             }
 
-            return agent;
+            return AGENT;
         }
     }
 }

Modified: geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityAgentService.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityAgentService.java?rev=1022792&r1=1022791&r2=1022792&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityAgentService.java
(original)
+++ geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityAgentService.java
Fri Oct 15 00:47:06 2010
@@ -22,9 +22,9 @@ package javax.availability.management;
  */
 public interface AvailabilityAgentService {
 
-    void reportError();
+    void disableHealthchecks();
 
     void enableHealthchecks();
 
-    void disableHealthchecks();
+    void reportError(HealthState state);
 }

Modified: geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityContainerController.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityContainerController.java?rev=1022792&r1=1022791&r2=1022792&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityContainerController.java
(original)
+++ geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityContainerController.java
Fri Oct 15 00:47:06 2010
@@ -17,20 +17,23 @@
  */
 package javax.availability.management;
 
+import java.util.Map;
+
+
 /**
  * @version $Rev$ $Date$
  */
 public interface AvailabilityContainerController extends AvailabilityUnitController {
 
-    void init(String name, AvailabilityAgentService service) throws AvailabilityException;
+    void activate(ActivationReason reason, Map<String, String> attributes) throws AvailabilityException;
 
-    void activate(ActivationReason reason) throws AvailabilityException;
+    void checkHealth() throws AvailabilityException;
 
     void deactivate(DeactivationReason reason) throws AvailabilityException;
 
-    void terminate() throws AvailabilityException;
-
-    void checkHealth() throws AvailabilityException;
+    void init(AvailabilityAgentService service) throws AvailabilityException;
 
     AvailabilityUnitController instantiateAvailabilityUnit(String name, AvailabilityAgentService
service) throws AvailabilityException;
+
+    void terminate() throws AvailabilityException;
 }

Modified: geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityException.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityException.java?rev=1022792&r1=1022791&r2=1022792&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityException.java
(original)
+++ geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityException.java
Fri Oct 15 00:47:06 2010
@@ -34,6 +34,6 @@ public class AvailabilityException exten
     }
 
     public AvailabilityException(Throwable cause) {
-        super(cause);
+        super(cause == null ? null : cause.toString(), cause);
     }
 }

Modified: geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityService.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityService.java?rev=1022792&r1=1022791&r2=1022792&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityService.java
(original)
+++ geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityService.java
Fri Oct 15 00:47:06 2010
@@ -17,16 +17,21 @@
  */
 package javax.availability.management;
 
+import java.util.Map;
+
+
 /**
  * @version $Rev$ $Date$
  */
 public interface AvailabilityService {
 
-    void reportError();
+    Map<String, String> getActivationAttributes();
 
     ActivationReason getActivationReason();
 
     DeactivationReason getDeactivationReason();
 
     String getName();
+
+    void reportError(HealthState state);
 }

Modified: geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityUnitController.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityUnitController.java?rev=1022792&r1=1022791&r2=1022792&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityUnitController.java
(original)
+++ geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/AvailabilityUnitController.java
Fri Oct 15 00:47:06 2010
@@ -17,16 +17,19 @@
  */
 package javax.availability.management;
 
+import java.util.Map;
+
+
 /**
  * @version $Rev$ $Date$
  */
 public interface AvailabilityUnitController {
 
-    void activate(ActivationReason reason) throws AvailabilityException;
+    void activate(ActivationReason reason, Map<String, String> attributes) throws AvailabilityException;
+
+    void checkHealth() throws AvailabilityException;
 
     void deactivate(DeactivationReason reason) throws AvailabilityException;
 
     void terminate() throws AvailabilityException;
-
-    void checkHealth() throws AvailabilityException;
 }

Modified: geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/DeactivationReason.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/DeactivationReason.java?rev=1022792&r1=1022791&r2=1022792&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/DeactivationReason.java
(original)
+++ geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/DeactivationReason.java
Fri Oct 15 00:47:06 2010
@@ -26,6 +26,5 @@ import java.io.Serializable;
 public enum DeactivationReason implements Serializable, Comparable<DeactivationReason>
{
 
     SHUT_DOWN,
-    SWITCH_OVER,
-    UPGRADE
+    SWITCH_OVER
 }

Modified: geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/HealthCheck.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/HealthCheck.java?rev=1022792&r1=1022791&r2=1022792&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/HealthCheck.java
(original)
+++ geronimo/specs/trunk/geronimo-availability_1.0_spec/src/main/java/javax/availability/management/HealthCheck.java
Fri Oct 15 00:47:06 2010
@@ -26,8 +26,8 @@ import java.lang.annotation.Target;
 /**
  * @version $Rev$ $Date$
  */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
+@Retention(value = RetentionPolicy.RUNTIME)
+@Target(value = ElementType.METHOD)
 public @interface HealthCheck {
 
 }
\ No newline at end of file



Mime
View raw message