river-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sijs...@apache.org
Subject svn commit: r1057547 - /incubator/river/jtsk/trunk/src/com/sun/jini/start/NonActivatableServiceDescriptor.java
Date Tue, 11 Jan 2011 09:39:24 GMT
Author: sijskes
Date: Tue Jan 11 09:39:24 2011
New Revision: 1057547

URL: http://svn.apache.org/viewvc?rev=1057547&view=rev
Log:
prepared for new service start signature

Modified:
    incubator/river/jtsk/trunk/src/com/sun/jini/start/NonActivatableServiceDescriptor.java

Modified: incubator/river/jtsk/trunk/src/com/sun/jini/start/NonActivatableServiceDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/com/sun/jini/start/NonActivatableServiceDescriptor.java?rev=1057547&r1=1057546&r2=1057547&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/com/sun/jini/start/NonActivatableServiceDescriptor.java
(original)
+++ incubator/river/jtsk/trunk/src/com/sun/jini/start/NonActivatableServiceDescriptor.java
Tue Jan 11 09:39:24 2011
@@ -220,6 +220,11 @@ public class NonActivatableServiceDescri
      */
     private final String[] serverConfigArgs;
 
+    /**
+     * serverConfigArgs override.
+     */
+    private final Configuration configuration ;
+
     /*
      * <code>LifeCycle</code> reference for hosting environment
      */
@@ -322,6 +327,7 @@ public class NonActivatableServiceDescri
 	this.classpath = importCodebase;
 	this.implClassName = implClassName;
 	this.serverConfigArgs = serverConfigArgs;
+        this.configuration = null ;
 	this.lifeCycle =
 	    (lifeCycle == null)?NoOpLifeCycle:lifeCycle;
         this.servicePreparer = preparer;    
@@ -619,15 +625,26 @@ public class NonActivatableServiceDescri
 
 	try {
             logger.finest("Attempting to get implementation constructor");
+
+            Object argParms[] = new Object[]{getServerConfigArgs(), lifeCycle} ;
+            Class argTypes[] = actTypes ;
+
+            if( configuration != null ) {
+                if( getServerConfigArgs() != null ) {
+                    logger.severe("both configArgs and configuration specified, using configuration");
+                }
+                argParms = new Object[]{configuration, lifeCycle} ;
+                argTypes = new Class[]{Configuration.class,  LifeCycle.class }; // TODO:make
static
+            }
+
 	    Constructor constructor =
-                implClass.getDeclaredConstructor(actTypes);
+                implClass.getDeclaredConstructor(argTypes);
             logger.log(Level.FINEST,
                 "Obtained implementation constructor: {0}",
                 constructor);
             constructor.setAccessible(true);
-            impl =
-                constructor.newInstance(
-		    new Object[]{getServerConfigArgs(), lifeCycle});
+            impl = constructor.newInstance(argParms);
+            
             logger.log(Level.FINEST,
                 "Obtained implementation instance: {0}", impl);
             if (impl instanceof ServiceProxyAccessor) {



Mime
View raw message