Skip to Content.
Sympa Menu

notify-dpml - r1097 - in trunk/main/metro: runtime/src/main/net/dpml/metro/runtime station/console/src/main/net/dpml/station/console test/src/main/net/dpml/test/composite tools/src/main/net/dpml/metro/tools

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: r1097 - in trunk/main/metro: runtime/src/main/net/dpml/metro/runtime station/console/src/main/net/dpml/station/console test/src/main/net/dpml/test/composite tools/src/main/net/dpml/metro/tools
  • Date: Wed, 15 Feb 2006 04:09:59 +0100

Author: mcconnell
Date: 2006-02-15 04:09:35 +0100 (Wed, 15 Feb 2006)
New Revision: 1097

Modified:

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

trunk/main/metro/station/console/src/main/net/dpml/station/console/StationPlugin.java
trunk/main/metro/test/src/main/net/dpml/test/composite/PartsComponent.java
trunk/main/metro/tools/src/main/net/dpml/metro/tools/ArrayDataType.java
trunk/main/metro/tools/src/main/net/dpml/metro/tools/EntryDataType.java
Log:
checkstyle

Modified:
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultContextModel.java
===================================================================
---
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultContextModel.java
2006-02-15 02:54:14 UTC (rev 1096)
+++
trunk/main/metro/runtime/src/main/net/dpml/metro/runtime/DefaultContextModel.java
2006-02-15 03:09:35 UTC (rev 1097)
@@ -34,7 +34,6 @@
import net.dpml.metro.ContextModelManager;
import net.dpml.metro.ValidationException;
import net.dpml.metro.ValidationException.Issue;
-import net.dpml.metro.ContextModel;

import net.dpml.logging.Logger;


Modified:
trunk/main/metro/station/console/src/main/net/dpml/station/console/StationPlugin.java
===================================================================
---
trunk/main/metro/station/console/src/main/net/dpml/station/console/StationPlugin.java
2006-02-15 02:54:14 UTC (rev 1096)
+++
trunk/main/metro/station/console/src/main/net/dpml/station/console/StationPlugin.java
2006-02-15 03:09:35 UTC (rev 1097)
@@ -122,30 +122,14 @@

if( m_logger.isDebugEnabled() )
{
- StringBuffer buffer =
- new StringBuffer(
- "Processing ["
- + args.length
- + "] args." );
- for( int i=0; i<args.length; i++ )
- {
- buffer.append(
- "\n "
- + ( i+1 )
- + " "
- + args[i] );
- }
- String message = buffer.toString();
- m_logger.debug( message );
+ logRawArguments(logger, args );
}

- // parse the command group model
+ // handle commands

Parser parser = new Parser();
parser.setGroup( COMMAND_GROUP );

- // handle command
-
try
{
CommandLine line = parser.parse( args );
@@ -729,7 +713,6 @@
*/
private void processControlCommand( Manager manager, String key ) throws
Exception
{
- //getLogger().info( "connecting to application [" + key + "]" );
Application application = manager.getApplication( key );
InputStreamReader isr = new InputStreamReader( System.in );
BufferedReader reader = new BufferedReader( isr );
@@ -769,109 +752,15 @@
}
else if( commandline.hasOption( CONTROL_APPLY_COMMAND ) )
{
- String id = (String) commandline.getValue(
CONTROL_APPLY_COMMAND, null );
- System.out.println( "\napplying transition: " + id );
- State state = application.getProvider().apply( id );
- System.out.println( "current state: " + state );
- System.out.println( "" );
+ applyTransition( application, commandline );
}
else if( commandline.hasOption( CONTROL_EXEC_COMMAND ) )
{
- String id = (String) commandline.getValues(
CONTROL_EXEC_COMMAND ).get( 0 );
- System.out.println( "\napplying operation: " + id );
- try
- {
- String[] applyArgs = getExecArgs( commandline );
- Object result = application.getProvider().exec(
id, applyArgs );
- if( null != result )
- {
- System.out.println( "listing return value\n"
);
- if( result instanceof Object[] )
- {
- Object[] values = (Object[]) result;
- for( int i=0; i<values.length; i++ )
- {
- System.out.println(
values[i].toString() );
- }
- }
- else
- {
- System.out.println( result.toString() );
- }
- System.out.println( "\ndone" );
- }
- else
- {
- System.out.println( "done" );
- }
- }
- catch( InvocationTargetException e )
- {
- Throwable cause = e.getCause();
- if( null != cause )
- {
- String error =
ExceptionHelper.packException( cause, true );
- System.out.println( error );
- }
- else
- {
- String error =
ExceptionHelper.packException( e, true );
- System.out.println( error );
- }
- }
- catch( Throwable e )
- {
- System.out.println( e.toString() );
- }
+ execOperation( application, commandline );
}
else if( commandline.hasOption( CONTROL_INVOKE_COMMAND )
)
{
- String method = (String) commandline.getValues(
CONTROL_INVOKE_COMMAND ).get( 0 );
- System.out.println( "\napplying operation: " +
method );
- try
- {
- String[] applyArgs = getInvokeArgs( commandline
);
- Object result =
application.getProvider().invoke( method, applyArgs );
- if( null != result )
- {
- System.out.println( "listing return value\n"
);
- if( result instanceof Object[] )
- {
- Object[] values = (Object[]) result;
- for( int i=0; i<values.length; i++ )
- {
- System.out.println(
values[i].toString() );
- }
- }
- else
- {
- System.out.println( result.toString() );
- }
- System.out.println( "\ndone" );
- }
- else
- {
- System.out.println( "done" );
- }
- }
- catch( InvocationTargetException e )
- {
- Throwable cause = e.getCause();
- if( null != cause )
- {
- String error =
ExceptionHelper.packException( cause, true );
- System.out.println( error );
- }
- else
- {
- String error =
ExceptionHelper.packException( e, true );
- System.out.println( error );
- }
- }
- catch( Throwable e )
- {
- System.out.println( e.toString() );
- }
+ invokeOperation( application, commandline );
}
}
catch( Exception e )
@@ -958,6 +847,115 @@
System.out.println( "" );
}

+ private void applyTransition( Application application, CommandLine
commandline ) throws Exception
+ {
+ String id = (String) commandline.getValue( CONTROL_APPLY_COMMAND,
null );
+ System.out.println( "\napplying transition: " + id );
+ State state = application.getProvider().apply( id );
+ System.out.println( "current state: " + state );
+ System.out.println( "" );
+ }
+
+ private void invokeOperation( Application application, CommandLine
commandline ) throws Exception
+ {
+ String method = (String) commandline.getValues(
CONTROL_INVOKE_COMMAND ).get( 0 );
+ System.out.println( "\ninvoking operation: " + method );
+ try
+ {
+ String[] applyArgs = getInvokeArgs( commandline );
+ Object result = application.getProvider().invoke( method,
applyArgs );
+ if( null != result )
+ {
+ System.out.println( "listing return value\n" );
+ if( result instanceof Object[] )
+ {
+ Object[] values = (Object[]) result;
+ for( int i=0; i<values.length; i++ )
+ {
+ System.out.println( values[i].toString() );
+ }
+ }
+ else
+ {
+ System.out.println( result.toString() );
+ }
+ System.out.println( "\ndone" );
+ }
+ else
+ {
+ System.out.println( "done" );
+ }
+ }
+ catch( InvocationTargetException e )
+ {
+ Throwable cause = e.getCause();
+ if( null != cause )
+ {
+ String error = ExceptionHelper.packException( cause, true );
+ System.out.println( error );
+ }
+ else
+ {
+ String error = ExceptionHelper.packException( e, true );
+ System.out.println( error );
+ }
+ }
+ catch( Throwable e )
+ {
+ System.out.println( e.toString() );
+ }
+ }
+
+ private void execOperation( Application application, CommandLine
commandline ) throws Exception
+ {
+ String id = (String) commandline.getValues( CONTROL_EXEC_COMMAND
).get( 0 );
+ System.out.println( "\napplying operation: " + id );
+ try
+ {
+ String[] applyArgs = getExecArgs( commandline );
+ Object result = application.getProvider().exec( id, applyArgs );
+ if( null != result )
+ {
+ System.out.println( "listing return value\n" );
+ if( result instanceof Object[] )
+ {
+ Object[] values = (Object[]) result;
+ for( int i=0; i<values.length; i++ )
+ {
+ System.out.println( values[i].toString() );
+ }
+ }
+ else
+ {
+ System.out.println( result.toString() );
+ }
+ System.out.println( "\ndone" );
+ }
+ else
+ {
+ System.out.println( "done" );
+ }
+ }
+ catch( InvocationTargetException e )
+ {
+ Throwable cause = e.getCause();
+ if( null != cause )
+ {
+ String error = ExceptionHelper.packException( cause, true );
+ System.out.println( error );
+ }
+ else
+ {
+ String error = ExceptionHelper.packException( e, true );
+ System.out.println( error );
+ }
+ }
+ catch( Throwable e )
+ {
+ System.out.println( e.toString() );
+ }
+ }
+
/**
* Handle a request for the shutdown of an application process.
* @param line the commandline
@@ -1254,6 +1252,25 @@
return m_logger;
}

+ private void logRawArguments( Logger logger, String[] args )
+ {
+ StringBuffer buffer =
+ new StringBuffer(
+ "Processing ["
+ + args.length
+ + "] args." );
+ for( int i=0; i<args.length; i++ )
+ {
+ buffer.append(
+ "\n "
+ + ( i+1 )
+ + " "
+ + args[i] );
+ }
+ String message = buffer.toString();
+ logger.debug( message );
+ }
+
private Station getStation( int port ) throws Exception
{
Registry registry = getLocalRegistry( port );

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-02-15 02:54:14 UTC (rev 1096)
+++
trunk/main/metro/test/src/main/net/dpml/test/composite/PartsComponent.java
2006-02-15 03:09:35 UTC (rev 1097)
@@ -86,6 +86,7 @@
* @param context a context implementation
* @param parts the parts manager
* @exception UnknownKeyException if the implementation uses a bad
reference
+ * @exception RemoteException if a remote I/O error occurs
*/
public PartsComponent(
final Logger logger, final Context context, final PartsManager parts )

Modified:
trunk/main/metro/tools/src/main/net/dpml/metro/tools/ArrayDataType.java
===================================================================
--- trunk/main/metro/tools/src/main/net/dpml/metro/tools/ArrayDataType.java
2006-02-15 02:54:14 UTC (rev 1096)
+++ trunk/main/metro/tools/src/main/net/dpml/metro/tools/ArrayDataType.java
2006-02-15 03:09:35 UTC (rev 1097)
@@ -22,7 +22,6 @@
import java.util.List;

import net.dpml.transit.Value;
-import net.dpml.transit.Construct;
import net.dpml.transit.Construct.Array;

import org.apache.tools.ant.BuildException;

Modified:
trunk/main/metro/tools/src/main/net/dpml/metro/tools/EntryDataType.java
===================================================================
--- trunk/main/metro/tools/src/main/net/dpml/metro/tools/EntryDataType.java
2006-02-15 02:54:14 UTC (rev 1096)
+++ trunk/main/metro/tools/src/main/net/dpml/metro/tools/EntryDataType.java
2006-02-15 03:09:35 UTC (rev 1097)
@@ -31,7 +31,6 @@
import net.dpml.metro.info.Type;

import net.dpml.transit.Value;
-import net.dpml.transit.Construct;

import org.apache.tools.ant.BuildException;





  • r1097 - in trunk/main/metro: runtime/src/main/net/dpml/metro/runtime station/console/src/main/net/dpml/station/console test/src/main/net/dpml/test/composite tools/src/main/net/dpml/metro/tools, mcconnell at BerliOS, 02/14/2006

Archive powered by MHonArc 2.6.24.

Top of Page