Skip to Content.
Sympa Menu

notify-dpml - r1252 - in trunk/main: metro metro/component/src/main/net/dpml/component metro/model/src/main/net/dpml/metro metro/runtime/src/main/net/dpml/metro/runtime metro/test/src/test/net/dpml/test/part metro/test/src/test/net/dpml/test/runtime planet/http/test/src/test/net/dpml/http/test station/exec/src/main/net/dpml/station/exec station/server/src/main/net/dpml/station/server util/job/api/src/main/net/dpml/job

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: r1252 - in trunk/main: metro metro/component/src/main/net/dpml/component metro/model/src/main/net/dpml/metro metro/runtime/src/main/net/dpml/metro/runtime metro/test/src/test/net/dpml/test/part metro/test/src/test/net/dpml/test/runtime planet/http/test/src/test/net/dpml/http/test station/exec/src/main/net/dpml/station/exec station/server/src/main/net/dpml/station/server util/job/api/src/main/net/dpml/job
  • Date: Wed, 22 Mar 2006 22:24:46 +0100

Author: mcconnell
Date: 2006-03-22 22:24:35 +0100 (Wed, 22 Mar 2006)
New Revision: 1252

Modified:
trunk/main/metro/component/src/main/net/dpml/component/Component.java
trunk/main/metro/model/src/main/net/dpml/metro/PartsManager.java
trunk/main/metro/module.xml

trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultComponentHandler.java

trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultPartsManager.java
trunk/main/metro/test/src/test/net/dpml/test/part/PartLoadingTestCase.java

trunk/main/metro/test/src/test/net/dpml/test/runtime/CategoriesTestCase.java

trunk/main/metro/test/src/test/net/dpml/test/runtime/DefaultComponentHandlerTestCase.java
trunk/main/metro/test/src/test/net/dpml/test/runtime/DisposalTestCase.java

trunk/main/metro/test/src/test/net/dpml/test/runtime/HardCollectionPolicyTestCase.java
trunk/main/metro/test/src/test/net/dpml/test/runtime/LifecycleTestCase.java
trunk/main/metro/test/src/test/net/dpml/test/runtime/ObserverTestCase.java
trunk/main/metro/test/src/test/net/dpml/test/runtime/ProviderTestCase.java

trunk/main/metro/test/src/test/net/dpml/test/runtime/SingletonProviderTestCase.java

trunk/main/metro/test/src/test/net/dpml/test/runtime/TransientProviderTestCase.java

trunk/main/metro/test/src/test/net/dpml/test/runtime/WeakCollectionPolicyTestCase.java
trunk/main/planet/http/test/src/test/net/dpml/http/test/ServerTestCase.java
trunk/main/station/exec/src/main/net/dpml/station/exec/AbstractAdapter.java

trunk/main/station/exec/src/main/net/dpml/station/exec/ApplicationHandler.java

trunk/main/station/exec/src/main/net/dpml/station/exec/ComponentAdapter.java

trunk/main/station/server/src/main/net/dpml/station/server/RemoteApplication.java
trunk/main/util/job/api/src/main/net/dpml/job/Commissionable.java
Log:
synchronize metro and station codebase with the new job commissioner
implementation

Modified:
trunk/main/metro/component/src/main/net/dpml/component/Component.java
===================================================================
--- trunk/main/metro/component/src/main/net/dpml/component/Component.java
2006-03-22 19:30:27 UTC (rev 1251)
+++ trunk/main/metro/component/src/main/net/dpml/component/Component.java
2006-03-22 21:24:35 UTC (rev 1252)
@@ -22,13 +22,15 @@
import java.rmi.Remote;
import java.rmi.RemoteException;

+import net.dpml.job.Commissionable;
+
/**
* The Component represents a remote interface to a runtime component type.
*
* @author <a href="@PUBLISHER-URL@">@PUBLISHER-NAME@</a>
* @version @PROJECT-VERSION@
*/
-public interface Component extends Remote
+public interface Component extends Remote, Commissionable
{
/**
* Return a handler capable of supporting the requested service.
@@ -62,19 +64,10 @@
ActivationPolicy getActivationPolicy() throws RemoteException;

/**
- * Initiate activation of a runtime handler.
- * @exception ControlException if an activation error occurs
- * @exception InvocationTargetException if the component declares
activation on startup
- * and a implementation source exception occured
+ * Returns the commissioned status of the handler.
+ * @return TRUE if the handler has been commissioned otherwise FALSE
* @exception RemoteException if a remote exception occurs
*/
- void activate() throws ControlException, InvocationTargetException,
RemoteException;
-
- /**
- * Returns the active status of the handler.
- * @return TRUE if the handler has been activated otherwise FALSE
- * @exception RemoteException if a remote exception occurs
- */
boolean isActive() throws RemoteException;

/**
@@ -95,10 +88,5 @@
*/
Provider getProvider() throws ControlException,
InvocationTargetException, RemoteException;

- /**
- * Deactivate the handler.
- * @exception RemoteException if a remote exception occurs
- */
- void deactivate() throws RemoteException;
}


Modified: trunk/main/metro/model/src/main/net/dpml/metro/PartsManager.java
===================================================================
--- trunk/main/metro/model/src/main/net/dpml/metro/PartsManager.java
2006-03-22 19:30:27 UTC (rev 1251)
+++ trunk/main/metro/model/src/main/net/dpml/metro/PartsManager.java
2006-03-22 21:24:35 UTC (rev 1252)
@@ -22,6 +22,8 @@

import net.dpml.lang.UnknownKeyException;

+import net.dpml.job.Commissionable;
+
/**
* Local interface through which a component implementation may
* interact with subsidary parts.

Modified: trunk/main/metro/module.xml
===================================================================
--- trunk/main/metro/module.xml 2006-03-22 19:30:27 UTC (rev 1251)
+++ trunk/main/metro/module.xml 2006-03-22 21:24:35 UTC (rev 1252)
@@ -29,6 +29,7 @@
</types>
<dependencies>
<include key="dpml-state-api" tag="public"/>
+ <include ref="dpml/util/dpml-job-api" tag="public"/>
<include ref="dpml/transit/dpml-transit-main" tag="private"/>
</dependencies>
<dependencies scope="test">
@@ -93,10 +94,11 @@
</types>
<dependencies>
<include ref="dpml/util/dpml-logging-api" tag="public"/>
+ <include key="dpml-metro-component" tag="protected"/>
+ <include key="dpml-metro-model" tag="protected"/>
<include ref="dpml/util/dpml-parameters-impl"/>
<include ref="dpml/util/dpml-configuration-impl"/>
- <include key="dpml-metro-component" tag="protected"/>
- <include key="dpml-metro-model" tag="protected"/>
+ <include ref="dpml/util/dpml-job-impl"/>
<include key="dpml-state-impl"/>
<include key="dpml-metro-builder"/>
</dependencies>

Modified:
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultComponentHandler.java
===================================================================
---
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultComponentHandler.java
2006-03-22 19:30:27 UTC (rev 1251)
+++
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultComponentHandler.java
2006-03-22 21:24:35 UTC (rev 1252)
@@ -328,7 +328,7 @@
public Provider getProvider() throws InvocationTargetException,
ControlException
{
getLogger().debug( "getProvider" );
- activate();
+ commission();
return m_holder.getProvider();
}

@@ -463,7 +463,7 @@
* @exception ControlException if an activation error occurs
* @exception InvocationTargetException if the client component raises an
error
*/
- public synchronized void activate() throws ControlException,
InvocationTargetException
+ public synchronized void commission() throws ControlException,
InvocationTargetException
{
if( isActive() )
{
@@ -527,7 +527,7 @@
catch( RemoteException e )
{
getLogger().warn( "activation failed due to a remote exception",
e );
- deactivate();
+ decommission();
final String error =
"Remote exception raised while attempting to access component
activation policy.";
throw new ControllerException( error, e );
@@ -535,26 +535,26 @@
catch( ControlException e )
{
getLogger().warn( "activation failed due to a control
exception", e );
- deactivate();
+ decommission();
throw e;
}
catch( InvocationTargetException e )
{
getLogger().warn( "activation failed due to a client initated
invocation exception", e );
- deactivate();
+ decommission();
throw e;
}
catch( Throwable e )
{
getLogger().warn( "activation failed due to a unexpected
exception", e );
- deactivate();
+ decommission();
}
finally
{
if( !m_active )
{
getLogger().warn( "activation failed" );
- deactivate();
+ decommission();
}
}
}
@@ -579,14 +579,14 @@
/**
* Deactivate the component.
*/
- public synchronized void deactivate()
+ public synchronized void decommission()
{
if( !isActive() )
{
return;
}

- getLogger().debug( "deactivating" );
+ getLogger().debug( "decommissioning" );

//
// dispose of all of the instances managed by this component

Modified:
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultPartsManager.java
===================================================================
---
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultPartsManager.java
2006-03-22 19:30:27 UTC (rev 1251)
+++
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultPartsManager.java
2006-03-22 21:24:35 UTC (rev 1252)
@@ -22,6 +22,7 @@
import java.util.Map;
import java.util.ArrayList;
import java.util.Hashtable;
+import java.lang.reflect.InvocationTargetException;

import net.dpml.logging.Logger;

@@ -39,6 +40,14 @@
import net.dpml.lang.Version;
import net.dpml.lang.UnknownKeyException;

+import net.dpml.job.Commissioner;
+import net.dpml.job.CommissionerEvent;
+import net.dpml.job.CommissionerController;
+import net.dpml.job.TimeoutException;
+import net.dpml.job.TimeoutError;
+
+import net.dpml.job.impl.DefaultCommissioner;
+
/**
* Default implementation of the local Parts interface.
*
@@ -265,6 +274,10 @@
throw new IllegalStateException( error );
}

+ String label = m_handler.toString();
+ DefaultCommissioner queue =
+ new DefaultCommissioner( label, true, new
InternalCommissionerController( true ) );
+
ControlException exception = null;
ArrayList list = new ArrayList();
Component[] components = getComponents();
@@ -278,8 +291,9 @@
{
if( component.getActivationPolicy().equals(
ActivationPolicy.STARTUP ) )
{
- component.activate();
list.add( component );
+ queue.add( component, 0 );
+ //component.commission();
}
}
catch( Throwable e )
@@ -313,10 +327,7 @@
{
if( !m_commissioned )
{
- final String error =
- "Illegal attempt to decommission a part manager that is
already decommissioned."
- + "Component: " + m_handler;
- throw new IllegalStateException( error );
+ return;
}

getLogger().debug( "decommissioning" );
@@ -329,6 +340,10 @@
*/
private void decommission( Component[] components )
{
+ String label = m_handler.toString();
+ DefaultCommissioner queue =
+ new DefaultCommissioner( label, false, new
InternalCommissionerController( false ) );
+
try
{
int n = components.length -1;
@@ -337,14 +352,24 @@
Component component = components[i];
try
{
- component.deactivate();
+ queue.add( component, 0 );
}
- catch( RemoteException e )
+ catch( Throwable e )
{
final String message =
- "Ignoring remote exception raised during
deactivation.";
+ "Ignoring exception raised during deactivation.";
getLogger().warn( message, e );
}
+ //try
+ //{
+ // component.decommission();
+ //}
+ //catch( RemoteException e )
+ //{
+ // final String message =
+ // "Ignoring remote exception raised during
deactivation.";
+ // getLogger().warn( message, e );
+ //}
}
}
finally
@@ -362,4 +387,138 @@
{
return m_logger;
}
+
+ /**
+ * Test controller.
+ */
+ public class InternalCommissionerController implements
CommissionerController
+ {
+ private boolean m_fail;
+
+ InternalCommissionerController( boolean fail )
+ {
+ m_fail = fail;
+ }
+
+ /**
+ * Notification that a commissioning or decommissioning
+ * process has commenced.
+ * @param event the commissioner event
+ */
+ public void started( CommissionerEvent event )
+ {
+ String message =
+ getAction( event )
+ + "["
+ + event.getSource()
+ + "]";
+ getLogger().debug( message );
+ }
+
+ /**
+ * Notification that a commissioning or decommissioning
+ * process has completed.
+ * @param event the commissioner event
+ */
+ public void completed( CommissionerEvent event )
+ {
+ String message =
+ getAction( event )
+ + "["
+ + event.getSource()
+ + "] completed in "
+ + event.getDuration()
+ + " milliseconds";
+ getLogger().debug( message );
+ }
+
+ /**
+ * Notification that a commissioning or decommissioning
+ * process has been interrupted.
+ * @param event the commissioner event
+ * @exception TimeoutException thrown ofter logging event
+ */
+ public void interrupted( CommissionerEvent event ) throws
TimeoutException
+ {
+ String message =
+ getAction( event )
+ + "of ["
+ + event.getSource()
+ + "] interrupted after "
+ + event.getDuration()
+ + " milliseconds";
+ getLogger().debug( message );
+ if( m_fail )
+ {
+ throw new TimeoutException( event.getDuration() );
+ }
+ }
+
+ /**
+ * Notification that a commissioning or decommissioning
+ * process has been terminated.
+ * @param event the commissioner event
+ * @exception TimeoutError thrown ofter logging event
+ */
+ public void terminated( CommissionerEvent event ) throws TimeoutError
+ {
+ String message =
+ getAction( event )
+ + "of ["
+ + event.getSource()
+ + "] terminated after "
+ + event.getDuration()
+ + " milliseconds";
+ getLogger().debug( message );
+ if( m_fail )
+ {
+ throw new TimeoutError( event.getDuration() );
+ }
+ }
+
+ /**
+ * Notification that a commissioning or decommissioning
+ * process failed.
+ * @param event the commissioner event
+ * @param cause the causal exception
+ * @exception InvocationTargetException throw after logging event
+ */
+ public void failed( CommissionerEvent event, Throwable cause )
throws InvocationTargetException
+ {
+ if( m_fail )
+ {
+ if( cause instanceof InvocationTargetException )
+ {
+ throw (InvocationTargetException) cause;
+ }
+ else
+ {
+ throw new InvocationTargetException( cause );
+ }
+ }
+ else
+ {
+ String message =
+ getAction( event )
+ + "of ["
+ + event.getSource()
+ + "] failed due ["
+ + cause.getClass().getName()
+ + "]";
+ getLogger().error( message, cause );
+ }
+ }
+
+ private String getAction( CommissionerEvent event )
+ {
+ if( event.isCommissioning() )
+ {
+ return "commissioning ";
+ }
+ else
+ {
+ return "decommissioning ";
+ }
+ }
+ }
}

Modified:
trunk/main/metro/test/src/test/net/dpml/test/part/PartLoadingTestCase.java
===================================================================
---
trunk/main/metro/test/src/test/net/dpml/test/part/PartLoadingTestCase.java
2006-03-22 19:30:27 UTC (rev 1251)
+++
trunk/main/metro/test/src/test/net/dpml/test/part/PartLoadingTestCase.java
2006-03-22 21:24:35 UTC (rev 1252)
@@ -60,7 +60,7 @@
*/
public void testPartLoading() throws Exception
{
- Logger.global.info( "commencing test." );
+ Logger.global.info( "commencing test" );

// initialize transit


Modified:
trunk/main/metro/test/src/test/net/dpml/test/runtime/CategoriesTestCase.java
===================================================================
---
trunk/main/metro/test/src/test/net/dpml/test/runtime/CategoriesTestCase.java
2006-03-22 19:30:27 UTC (rev 1251)
+++
trunk/main/metro/test/src/test/net/dpml/test/runtime/CategoriesTestCase.java
2006-03-22 21:24:35 UTC (rev 1252)
@@ -62,7 +62,7 @@
Component component = CONTROLLER.createComponent( m_uri );
Provider provider = component.getProvider();
CategoriesComponent instance = (CategoriesComponent)
provider.getValue( false );
- component.deactivate();
+ component.decommission();
}

static

Modified:
trunk/main/metro/test/src/test/net/dpml/test/runtime/DefaultComponentHandlerTestCase.java
===================================================================
---
trunk/main/metro/test/src/test/net/dpml/test/runtime/DefaultComponentHandlerTestCase.java
2006-03-22 19:30:27 UTC (rev 1251)
+++
trunk/main/metro/test/src/test/net/dpml/test/runtime/DefaultComponentHandlerTestCase.java
2006-03-22 21:24:35 UTC (rev 1252)
@@ -71,9 +71,9 @@
public void testActivationDeactivationCycle() throws Exception
{
Component component = CONTROLLER.createComponent( m_uri );
- component.activate();
+ component.commission();
assertTrue( "is-active", component.isActive() );
- component.deactivate();
+ component.decommission();
assertFalse( "is-active-following-deactivation",
component.isActive() );
}


Modified:
trunk/main/metro/test/src/test/net/dpml/test/runtime/DisposalTestCase.java
===================================================================
---
trunk/main/metro/test/src/test/net/dpml/test/runtime/DisposalTestCase.java
2006-03-22 19:30:27 UTC (rev 1251)
+++
trunk/main/metro/test/src/test/net/dpml/test/runtime/DisposalTestCase.java
2006-03-22 21:24:35 UTC (rev 1252)
@@ -57,7 +57,7 @@
public void testHandlerDisposal() throws Exception
{
Component component = CONTROLLER.createComponent( m_uri );
- component.activate();
+ component.commission();
for( int i=0; i<1000; i++ )
{
component.getProvider();

Modified:
trunk/main/metro/test/src/test/net/dpml/test/runtime/HardCollectionPolicyTestCase.java
===================================================================
---
trunk/main/metro/test/src/test/net/dpml/test/runtime/HardCollectionPolicyTestCase.java
2006-03-22 19:30:27 UTC (rev 1251)
+++
trunk/main/metro/test/src/test/net/dpml/test/runtime/HardCollectionPolicyTestCase.java
2006-03-22 21:24:35 UTC (rev 1252)
@@ -59,7 +59,7 @@
public void testCollection() throws Exception
{
Component component = CONTROLLER.createComponent( m_uri );
- component.activate();
+ component.commission();
assertTrue( "is-active", component.isActive() );
Provider one = component.getProvider();
Provider two = component.getProvider();
@@ -86,7 +86,7 @@
//

assertEquals( "count", 1, count );
- component.deactivate();
+ component.decommission();
}

static

Modified:
trunk/main/metro/test/src/test/net/dpml/test/runtime/LifecycleTestCase.java
===================================================================
---
trunk/main/metro/test/src/test/net/dpml/test/runtime/LifecycleTestCase.java
2006-03-22 19:30:27 UTC (rev 1251)
+++
trunk/main/metro/test/src/test/net/dpml/test/runtime/LifecycleTestCase.java
2006-03-22 21:24:35 UTC (rev 1252)
@@ -63,7 +63,7 @@
Provider instance = component.getProvider();
StartableComponent startable = (StartableComponent)
instance.getValue( false );
assertTrue( "component is started", startable.wasStarted() );
- component.deactivate();
+ component.decommission();
assertTrue( "component is stopped", startable.wasStopped() );
}


Modified:
trunk/main/metro/test/src/test/net/dpml/test/runtime/ObserverTestCase.java
===================================================================
---
trunk/main/metro/test/src/test/net/dpml/test/runtime/ObserverTestCase.java
2006-03-22 19:30:27 UTC (rev 1251)
+++
trunk/main/metro/test/src/test/net/dpml/test/runtime/ObserverTestCase.java
2006-03-22 21:24:35 UTC (rev 1252)
@@ -67,6 +67,6 @@
String key = "color";
ValueDirective newDirective = new ValueDirective(
Color.class.getName(), "BLUE", (String) null );
context.setEntryDirective( key, newDirective );
- component.deactivate();
+ component.decommission();
}
}

Modified:
trunk/main/metro/test/src/test/net/dpml/test/runtime/ProviderTestCase.java
===================================================================
---
trunk/main/metro/test/src/test/net/dpml/test/runtime/ProviderTestCase.java
2006-03-22 19:30:27 UTC (rev 1251)
+++
trunk/main/metro/test/src/test/net/dpml/test/runtime/ProviderTestCase.java
2006-03-22 21:24:35 UTC (rev 1252)
@@ -65,12 +65,12 @@
public void testStateListenerAdditionAndRemoval() throws Exception
{
Component component = CONTROLLER.createComponent( m_uri );
- component.activate();
+ component.commission();
Provider instance = component.getProvider();
StateListener listener = new DefaultStateListener();
instance.addStateListener( listener );
instance.removeStateListener( listener );
- component.deactivate();
+ component.decommission();
}

/**
@@ -80,7 +80,7 @@
public void testNullListenerAddition() throws Exception
{
Component component = CONTROLLER.createComponent( m_uri );
- component.activate();
+ component.commission();
Provider instance = component.getProvider();
try
{
@@ -93,7 +93,7 @@
}
finally
{
- component.deactivate();
+ component.decommission();
}
}

@@ -104,7 +104,7 @@
public void testNullListenerRemoval() throws Exception
{
Component component = CONTROLLER.createComponent( m_uri );
- component.activate();
+ component.commission();
Provider instance = component.getProvider();
try
{
@@ -117,7 +117,7 @@
}
finally
{
- component.deactivate();
+ component.decommission();
}
}

@@ -128,7 +128,7 @@
public void testUnknownListenerRemoval() throws Exception
{
Component component = CONTROLLER.createComponent( m_uri );
- component.activate();
+ component.commission();
Provider instance = component.getProvider();
try
{
@@ -142,7 +142,7 @@
}
finally
{
- component.deactivate();
+ component.decommission();
}
}

@@ -163,12 +163,12 @@
State state = (State) event.getNewValue();
}
} );
- component.activate();
+ component.commission();
assertTrue( "is-active", component.isActive() );
Provider instance = component.getProvider();
instance.addStateListener( listener );
instance.removeStateListener( listener );
- component.deactivate();
+ component.decommission();
assertFalse( "is-active-following-deactivation",
component.isActive() );
}

@@ -179,7 +179,7 @@
public void testValueInstantiationWithProxy() throws Exception
{
Component component = CONTROLLER.createComponent( m_uri );
- component.activate();
+ component.commission();
try
{
Provider instance = component.getProvider();
@@ -190,7 +190,7 @@
}
finally
{
- component.deactivate();
+ component.decommission();
}
}

@@ -201,7 +201,7 @@
public void testValueInstantiationWithoutProxy() throws Exception
{
Component component = CONTROLLER.createComponent( m_uri );
- component.activate();
+ component.commission();
try
{
Provider instance = component.getProvider();
@@ -212,7 +212,7 @@
}
finally
{
- component.deactivate();
+ component.decommission();
}
}


Modified:
trunk/main/metro/test/src/test/net/dpml/test/runtime/SingletonProviderTestCase.java
===================================================================
---
trunk/main/metro/test/src/test/net/dpml/test/runtime/SingletonProviderTestCase.java
2006-03-22 19:30:27 UTC (rev 1251)
+++
trunk/main/metro/test/src/test/net/dpml/test/runtime/SingletonProviderTestCase.java
2006-03-22 21:24:35 UTC (rev 1252)
@@ -56,12 +56,12 @@
public void testSharedProviderSemantics() throws Exception
{
Component component = CONTROLLER.createComponent( m_uri );
- component.activate();
+ component.commission();
assertTrue( "is-active", component.isActive() );
Provider firstProvider = component.getProvider();
Provider secondProvider = component.getProvider();
assertEquals( "singletons-are-equal", firstProvider, secondProvider
);
- component.deactivate();
+ component.decommission();
}

static

Modified:
trunk/main/metro/test/src/test/net/dpml/test/runtime/TransientProviderTestCase.java
===================================================================
---
trunk/main/metro/test/src/test/net/dpml/test/runtime/TransientProviderTestCase.java
2006-03-22 19:30:27 UTC (rev 1251)
+++
trunk/main/metro/test/src/test/net/dpml/test/runtime/TransientProviderTestCase.java
2006-03-22 21:24:35 UTC (rev 1252)
@@ -56,7 +56,7 @@
public void testTransientProviderSemantics() throws Exception
{
Component component = CONTROLLER.createComponent( m_uri );
- component.activate();
+ component.commission();
assertTrue( "is-active", component.isActive() );
Provider firstProvider = component.getProvider();
Provider secondProvider = component.getProvider();
@@ -64,7 +64,7 @@
{
fail( "Transient identity must be unique" );
}
- component.deactivate();
+ component.decommission();
}

static

Modified:
trunk/main/metro/test/src/test/net/dpml/test/runtime/WeakCollectionPolicyTestCase.java
===================================================================
---
trunk/main/metro/test/src/test/net/dpml/test/runtime/WeakCollectionPolicyTestCase.java
2006-03-22 19:30:27 UTC (rev 1251)
+++
trunk/main/metro/test/src/test/net/dpml/test/runtime/WeakCollectionPolicyTestCase.java
2006-03-22 21:24:35 UTC (rev 1252)
@@ -56,7 +56,7 @@
public void testCollection() throws Exception
{
Component component = CONTROLLER.createComponent( m_uri );
- component.activate();
+ component.commission();
assertTrue( "is-active", component.isActive() );
Provider one = component.getProvider();
Provider two = component.getProvider();
@@ -83,7 +83,7 @@
//

assertEquals( "count", 0, count );
- component.deactivate();
+ component.decommission();
}

static

Modified:
trunk/main/planet/http/test/src/test/net/dpml/http/test/ServerTestCase.java
===================================================================
---
trunk/main/planet/http/test/src/test/net/dpml/http/test/ServerTestCase.java
2006-03-22 19:30:27 UTC (rev 1251)
+++
trunk/main/planet/http/test/src/test/net/dpml/http/test/ServerTestCase.java
2006-03-22 21:24:35 UTC (rev 1252)
@@ -73,13 +73,12 @@
}
finally
{
- component.deactivate();
+ component.decommission();
}
}

static
{
- //System.setProperty( "dpml.logging.config",
"local:properties:dpml/transit/debug" );
System.setProperty(
"java.util.logging.config.class",
System.getProperty(

Modified:
trunk/main/station/exec/src/main/net/dpml/station/exec/AbstractAdapter.java
===================================================================
---
trunk/main/station/exec/src/main/net/dpml/station/exec/AbstractAdapter.java
2006-03-22 19:30:27 UTC (rev 1251)
+++
trunk/main/station/exec/src/main/net/dpml/station/exec/AbstractAdapter.java
2006-03-22 21:24:35 UTC (rev 1252)
@@ -103,7 +103,7 @@
* and a implementation instantiation exception occurs
* @exception RemoteException if a remote exception occurs
*/
- public void activate() throws ControlException,
InvocationTargetException, RemoteException
+ public void commission() throws ControlException,
InvocationTargetException, RemoteException
{
m_activated = true;
}
@@ -146,7 +146,7 @@
* Deactivate the handler.
* @exception RemoteException if a remote exception occurs
*/
- public void deactivate() throws RemoteException
+ public void decommission() throws RemoteException
{
m_activated = false;
}

Modified:
trunk/main/station/exec/src/main/net/dpml/station/exec/ApplicationHandler.java
===================================================================
---
trunk/main/station/exec/src/main/net/dpml/station/exec/ApplicationHandler.java
2006-03-22 19:30:27 UTC (rev 1251)
+++
trunk/main/station/exec/src/main/net/dpml/station/exec/ApplicationHandler.java
2006-03-22 21:24:35 UTC (rev 1252)
@@ -421,7 +421,7 @@
m_handler = handler;
try
{
- handler.activate();
+ handler.commission();
}
catch( Exception e )
{
@@ -430,7 +430,7 @@
getLogger().error( error, e );
try
{
- handler.deactivate();
+ handler.decommission();
}
catch( Exception deactivationError )
{
@@ -455,7 +455,7 @@
getLogger().error( error, throwable );
try
{
- m_handler.deactivate();
+ m_handler.decommission();
}
catch( Throwable e )
{

Modified:
trunk/main/station/exec/src/main/net/dpml/station/exec/ComponentAdapter.java
===================================================================
---
trunk/main/station/exec/src/main/net/dpml/station/exec/ComponentAdapter.java
2006-03-22 19:30:27 UTC (rev 1251)
+++
trunk/main/station/exec/src/main/net/dpml/station/exec/ComponentAdapter.java
2006-03-22 21:24:35 UTC (rev 1252)
@@ -225,12 +225,12 @@
* and a implementation source exception occured
* @exception RemoteException if a remote exception occurs
*/
- public void activate() throws ControlException,
InvocationTargetException, RemoteException
+ public void commission() throws ControlException,
InvocationTargetException, RemoteException
{
- m_component.activate();
+ m_component.decommission();
m_instance = m_component.getProvider();
m_object = m_component.getProvider().getValue( false );
-}
+ }

/**
* Return the number of instances currently under management.
@@ -260,9 +260,9 @@
* Deactivate the handler.
* @exception RemoteException if a remote exception occurs
*/
- public void deactivate() throws RemoteException
+ public void decommission() throws RemoteException
{
- m_component.deactivate();
+ m_component.decommission();
}

/**

Modified:
trunk/main/station/server/src/main/net/dpml/station/server/RemoteApplication.java
===================================================================
---
trunk/main/station/server/src/main/net/dpml/station/server/RemoteApplication.java
2006-03-22 19:30:27 UTC (rev 1251)
+++
trunk/main/station/server/src/main/net/dpml/station/server/RemoteApplication.java
2006-03-22 21:24:35 UTC (rev 1252)
@@ -118,7 +118,7 @@
{
try
{
- handler.deactivate();
+ handler.decommission();
}
catch( Exception ee )
{
@@ -265,7 +265,6 @@
"Process establishment failure.";
throw new ApplicationException( error, e );
}
-
}

Logger logger = getLogger();
@@ -405,7 +404,7 @@
{
try
{
- m_handler.deactivate();
+ m_handler.decommission();
}
catch( Throwable e )
{

Modified: trunk/main/util/job/api/src/main/net/dpml/job/Commissionable.java
===================================================================
--- trunk/main/util/job/api/src/main/net/dpml/job/Commissionable.java
2006-03-22 19:30:27 UTC (rev 1251)
+++ trunk/main/util/job/api/src/main/net/dpml/job/Commissionable.java
2006-03-22 21:24:35 UTC (rev 1252)
@@ -18,6 +18,8 @@

package net.dpml.job;

+import java.rmi.RemoteException;
+
/**
* Interface implemented by objects that implement
commission/decommmissioning
* lifecycles.
@@ -36,5 +38,5 @@
/**
* Decommission the instance.
*/
- void decommission();
+ void decommission() throws RemoteException;
}




  • r1252 - in trunk/main: metro metro/component/src/main/net/dpml/component metro/model/src/main/net/dpml/metro metro/runtime/src/main/net/dpml/metro/runtime metro/test/src/test/net/dpml/test/part metro/test/src/test/net/dpml/test/runtime planet/http/test/src/test/net/dpml/http/test station/exec/src/main/net/dpml/station/exec station/server/src/main/net/dpml/station/server util/job/api/src/main/net/dpml/job, mcconnell at BerliOS, 03/22/2006

Archive powered by MHonArc 2.6.24.

Top of Page