notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
r954 - in trunk/main: metro/part/api/src/main/net/dpml/part/local metro/part/content/src/main/net/dpml/part/content metro/runtime/src/main/net/dpml/metro/runtime metro/test/src/main/net/dpml/test/composite metro/tools/src/main/net/dpml/metro/tools transit/core/src/main/net/dpml/transit transit/core/src/test/net/dpml/transit/test
- From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
- To: notify-dpml AT lists.ibiblio.org
- Subject: r954 - in trunk/main: metro/part/api/src/main/net/dpml/part/local metro/part/content/src/main/net/dpml/part/content metro/runtime/src/main/net/dpml/metro/runtime metro/test/src/main/net/dpml/test/composite metro/tools/src/main/net/dpml/metro/tools transit/core/src/main/net/dpml/transit transit/core/src/test/net/dpml/transit/test
- Date: Mon, 23 Jan 2006 06:22:36 +0100
Author: mcconnell
Date: 2006-01-23 06:22:31 +0100 (Mon, 23 Jan 2006)
New Revision: 954
Modified:
trunk/main/metro/part/api/src/main/net/dpml/part/local/Handler.java
trunk/main/metro/part/api/src/main/net/dpml/part/local/InitialContext.java
trunk/main/metro/part/api/src/main/net/dpml/part/local/PartsManager.java
trunk/main/metro/part/content/src/main/net/dpml/part/content/PartContentHandler.java
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/CompositionController.java
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/UnicastEventSource.java
trunk/main/metro/test/src/main/net/dpml/test/composite/PartsComponent.java
trunk/main/metro/tools/src/main/net/dpml/metro/tools/ClassLoaderBuilderTask.java
trunk/main/metro/tools/src/main/net/dpml/metro/tools/PartDataType.java
trunk/main/transit/core/src/main/net/dpml/transit/DefaultModel.java
trunk/main/transit/core/src/main/net/dpml/transit/DefaultTransitModel.java
trunk/main/transit/core/src/test/net/dpml/transit/test/DisposalTestCase.java
Log:
checkstyle cleanup
Modified: trunk/main/metro/part/api/src/main/net/dpml/part/local/Handler.java
===================================================================
--- trunk/main/metro/part/api/src/main/net/dpml/part/local/Handler.java
2006-01-23 04:08:06 UTC (rev 953)
+++ trunk/main/metro/part/api/src/main/net/dpml/part/local/Handler.java
2006-01-23 05:22:31 UTC (rev 954)
@@ -22,10 +22,7 @@
import java.util.Map;
import net.dpml.part.ControlException;
-
-import net.dpml.part.remote.Component;
import net.dpml.part.remote.Provider;
-import net.dpml.part.remote.Model;
/**
* Local interface through which a component implementation may
Modified:
trunk/main/metro/part/api/src/main/net/dpml/part/local/InitialContext.java
===================================================================
---
trunk/main/metro/part/api/src/main/net/dpml/part/local/InitialContext.java
2006-01-23 04:08:06 UTC (rev 953)
+++
trunk/main/metro/part/api/src/main/net/dpml/part/local/InitialContext.java
2006-01-23 05:22:31 UTC (rev 954)
@@ -53,6 +53,8 @@
* Create the default controller using the default initial context.
* The default context and associated controller disposal will be
triggered
* on JVM shutdown.
+ *
+ * @return the default controller
*/
public static Controller createController()
{
@@ -64,6 +66,7 @@
* of the client application.
*
* @param context the controller context
+ * @return the controller
*/
public static Controller createController( final InitialContext context )
{
@@ -73,7 +76,11 @@
Controller.class.getClassLoader(), new Class[]{Controller.class},
handler );
}
- private static class ControllerInvocationHandler implements
InvocationHandler
+ /**
+ * Internal invocation handler that delays controller instantiation
+ * until a request against the controller is made by a client.
+ */
+ private static final class ControllerInvocationHandler implements
InvocationHandler
{
private InitialContext m_context;
private Controller m_controller;
@@ -450,15 +457,25 @@
}
}
+ /**
+ * Internal utility class to handle context disposal on JVM shutdown.
+ */
private static class ContextShutdownHook extends Thread
{
private InitialContext m_context;
+ /**
+ * Creation of a new initial context shutdown hook.
+ * @param context the initional context to be shutdown on JVM shutdown
+ */
ContextShutdownHook( InitialContext context )
{
m_context = context;
}
+ /**
+ * Execute context disposal.
+ */
public void run()
{
try
Modified:
trunk/main/metro/part/api/src/main/net/dpml/part/local/PartsManager.java
===================================================================
--- trunk/main/metro/part/api/src/main/net/dpml/part/local/PartsManager.java
2006-01-23 04:08:06 UTC (rev 953)
+++ trunk/main/metro/part/api/src/main/net/dpml/part/local/PartsManager.java
2006-01-23 05:22:31 UTC (rev 954)
@@ -43,6 +43,7 @@
* Return an internal component.
* @param key the internal component key
* @return the component
+ * @exception UnknownKeyException the key is not recognized
*/
Component getComponent( String key ) throws UnknownKeyException;
@@ -57,7 +58,7 @@
* Return a local component handler.
* @param key the internal part key
* @return the local component handler
- * @exception UnknownPartException the key is not recognized
+ * @exception UnknownKeyException the key is not recognized
*/
Handler getComponentHandler( String key ) throws UnknownKeyException;
Modified:
trunk/main/metro/part/content/src/main/net/dpml/part/content/PartContentHandler.java
===================================================================
---
trunk/main/metro/part/content/src/main/net/dpml/part/content/PartContentHandler.java
2006-01-23 04:08:06 UTC (rev 953)
+++
trunk/main/metro/part/content/src/main/net/dpml/part/content/PartContentHandler.java
2006-01-23 05:22:31 UTC (rev 954)
@@ -24,11 +24,8 @@
import java.net.URL;
import java.io.IOException;
-import net.dpml.transit.Logger;
-
import net.dpml.part.Directive;
import net.dpml.part.local.Controller;
-import net.dpml.part.local.InitialContext;
import net.dpml.part.remote.Model;
import net.dpml.part.remote.Component;
import net.dpml.part.remote.Provider;
Modified:
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/CompositionController.java
===================================================================
---
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/CompositionController.java
2006-01-23 04:08:06 UTC (rev 953)
+++
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/CompositionController.java
2006-01-23 05:22:31 UTC (rev 954)
@@ -46,7 +46,6 @@
import net.dpml.transit.Repository;
import net.dpml.transit.Transit;
-import net.dpml.transit.util.ExceptionHelper;
/**
* The composition controller is the controller used to establish remotely
accessible
@@ -349,7 +348,7 @@
{
getLogger().debug( "initating controller disposal" );
m_context.removeControllerContextListener( m_listener );
- m_EVENT_DISPATCH_THREAD.dispose();
+ m_dispatch.dispose();
getLogger().debug( "disposal complete" );
}
@@ -499,7 +498,7 @@
}
}
- private EventDispatchThread m_EVENT_DISPATCH_THREAD = null;
+ private EventDispatchThread m_dispatch = null;
/**
* This method starts the event dispatch thread the first time it
@@ -508,20 +507,27 @@
*/
private synchronized void startEventDispatchThread()
{
- if( m_EVENT_DISPATCH_THREAD == null )
+ if( m_dispatch == null )
{
Logger logger = getLogger().getChildLogger( "event" );
- m_EVENT_DISPATCH_THREAD = new EventDispatchThread( logger );
- m_EVENT_DISPATCH_THREAD.setDaemon( true );
- m_EVENT_DISPATCH_THREAD.start();
+ m_dispatch = new EventDispatchThread( logger );
+ m_dispatch.setDaemon( true );
+ m_dispatch.start();
}
}
+ /**
+ * Controller context listener.
+ */
private class InternalControllerContextListener implements
ControllerContextListener
{
private final CompositionController m_controller;
- public InternalControllerContextListener( final
CompositionController controller )
+ /**
+ * Creation of a new controller context listener.
+ * @param controller the controller to which change event actions are
applied
+ */
+ InternalControllerContextListener( final CompositionController
controller )
{
m_controller = controller;
}
Modified:
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/UnicastEventSource.java
===================================================================
---
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/UnicastEventSource.java
2006-01-23 04:08:06 UTC (rev 953)
+++
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/UnicastEventSource.java
2006-01-23 05:22:31 UTC (rev 954)
@@ -23,13 +23,9 @@
import java.rmi.NoSuchObjectException;
import java.util.EventObject;
import java.util.EventListener;
-import java.util.List;
-import java.util.LinkedList;
import net.dpml.logging.Logger;
-import net.dpml.transit.util.ExceptionHelper;
-
/**
* A abstract base class that established an event queue and handles event
dispatch
* operations for listeners declared in a class extending this base class.
@@ -55,6 +51,7 @@
/**
* Creation of a new <tt>UnicastEventSource</tt>.
+ * @param logger the assigned logging channel
* @exception RemoteException if a remote I/O exception occurs
*/
protected UnicastEventSource( Logger logger ) throws RemoteException
@@ -205,12 +202,21 @@
private final UnicastEventSource m_source;
private final Logger m_logger;
+ /**
+ * Internal class terminator that handles unexport of an event source
+ * under a separate thread.
+ * @param source the event source instance
+ * @param logger the event source logger
+ */
Terminator( UnicastEventSource source, Logger logger )
{
m_source = source;
m_logger = logger;
}
+ /**
+ * Terminator execution.
+ */
public void run()
{
try
Modified:
trunk/main/metro/test/src/main/net/dpml/test/composite/PartsComponent.java
===================================================================
---
trunk/main/metro/test/src/main/net/dpml/test/composite/PartsComponent.java
2006-01-23 04:08:06 UTC (rev 953)
+++
trunk/main/metro/test/src/main/net/dpml/test/composite/PartsComponent.java
2006-01-23 05:22:31 UTC (rev 954)
@@ -85,8 +85,11 @@
* @param logger the assingned logging channel
* @param context a context implementation
* @param parts the parts manager
+ * @exception UnknownKeyException if the implementation uses a bad
reference
*/
- public PartsComponent( final Logger logger, final Context context, final
PartsManager parts ) throws UnknownKeyException
+ public PartsComponent(
+ final Logger logger, final Context context, final PartsManager parts )
+ throws UnknownKeyException
{
logger.debug( "instantiation" );
Modified:
trunk/main/metro/tools/src/main/net/dpml/metro/tools/ClassLoaderBuilderTask.java
===================================================================
---
trunk/main/metro/tools/src/main/net/dpml/metro/tools/ClassLoaderBuilderTask.java
2006-01-23 04:08:06 UTC (rev 953)
+++
trunk/main/metro/tools/src/main/net/dpml/metro/tools/ClassLoaderBuilderTask.java
2006-01-23 05:22:31 UTC (rev 954)
@@ -22,8 +22,6 @@
import java.net.URI;
import java.net.URISyntaxException;
-//import net.dpml.metro.runtime.CompositionController;
-
import net.dpml.metro.data.ClassLoaderDirective;
import net.dpml.metro.data.ClasspathDirective;
@@ -34,8 +32,6 @@
import net.dpml.part.local.Controller;
-import net.dpml.transit.tools.AntAdapter;
-import net.dpml.transit.Logger;
import net.dpml.transit.Category;
import org.apache.tools.ant.AntClassLoader;
Modified:
trunk/main/metro/tools/src/main/net/dpml/metro/tools/PartDataType.java
===================================================================
--- trunk/main/metro/tools/src/main/net/dpml/metro/tools/PartDataType.java
2006-01-23 04:08:06 UTC (rev 953)
+++ trunk/main/metro/tools/src/main/net/dpml/metro/tools/PartDataType.java
2006-01-23 05:22:31 UTC (rev 954)
@@ -22,7 +22,6 @@
import java.net.URI;
import java.net.URISyntaxException;
-import net.dpml.metro.runtime.CompositionController;
import net.dpml.metro.info.PartReference;
import net.dpml.metro.info.Type;
@@ -31,9 +30,6 @@
import net.dpml.part.PartNotFoundException;
import net.dpml.part.local.Controller;
-import net.dpml.transit.Logger;
-import net.dpml.transit.tools.AntAdapter;
-
import org.apache.tools.ant.Task;
import org.apache.tools.ant.BuildException;
Modified: trunk/main/transit/core/src/main/net/dpml/transit/DefaultModel.java
===================================================================
--- trunk/main/transit/core/src/main/net/dpml/transit/DefaultModel.java
2006-01-23 04:08:06 UTC (rev 953)
+++ trunk/main/transit/core/src/main/net/dpml/transit/DefaultModel.java
2006-01-23 05:22:31 UTC (rev 954)
@@ -151,6 +151,9 @@
return m_logger;
}
+ /**
+ * Dispose of the model.
+ */
public synchronized void dispose()
{
EventListener[] listeners = listeners();
@@ -162,6 +165,9 @@
getLogger().debug( "disposed" );
}
+ /**
+ * Terminate the dispatch thread.
+ */
synchronized void terminateDispatchThread()
{
if( null != m_EVENT_DISPATCH_THREAD )
Modified:
trunk/main/transit/core/src/main/net/dpml/transit/DefaultTransitModel.java
===================================================================
---
trunk/main/transit/core/src/main/net/dpml/transit/DefaultTransitModel.java
2006-01-23 04:08:06 UTC (rev 953)
+++
trunk/main/transit/core/src/main/net/dpml/transit/DefaultTransitModel.java
2006-01-23 05:22:31 UTC (rev 954)
@@ -222,6 +222,9 @@
thread.start();
}
+ /**
+ * Internal model terminator.
+ */
private class Terminator extends Thread
{
private final DefaultTransitModel m_model;
@@ -230,6 +233,9 @@
m_model = model;
}
+ /**
+ * Initiate model retraction from the RMI.
+ */
public void run()
{
try
Modified:
trunk/main/transit/core/src/test/net/dpml/transit/test/DisposalTestCase.java
===================================================================
---
trunk/main/transit/core/src/test/net/dpml/transit/test/DisposalTestCase.java
2006-01-23 04:08:06 UTC (rev 953)
+++
trunk/main/transit/core/src/test/net/dpml/transit/test/DisposalTestCase.java
2006-01-23 05:22:31 UTC (rev 954)
@@ -33,17 +33,30 @@
{
private DefaultTransitModel m_model;
+ /**
+ * Setup the testcase during which an instance of DefaultTransitModel
+ * is created and cached so that we can invoke model tear-down on
+ * completion of the test.
+ * @exception Exception if something goes pear-shaped
+ */
public void setUp() throws Exception
{
m_model = DefaultTransitModel.getDefaultModel();
Transit.getInstance( m_model );
}
+ /**
+ * Nothing here - ant's Junit requires at least a single test but the
+ * real testing is in no exceptions under setup and teardown.
+ */
public void testSetupAndTearDown()
{
// trigger setup and teardown
}
+ /**
+ * Dispose of the transit model.
+ */
public void tearDown()
{
m_model.dispose();
- r954 - in trunk/main: metro/part/api/src/main/net/dpml/part/local metro/part/content/src/main/net/dpml/part/content metro/runtime/src/main/net/dpml/metro/runtime metro/test/src/main/net/dpml/test/composite metro/tools/src/main/net/dpml/metro/tools transit/core/src/main/net/dpml/transit transit/core/src/test/net/dpml/transit/test, mcconnell at BerliOS, 01/23/2006
Archive powered by MHonArc 2.6.24.