You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mc...@apache.org on 2002/09/07 21:05:41 UTC
cvs commit: jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/service DefaultServiceManagementContext.java
mcconnell 2002/09/07 12:05:41
Modified: assembly .cvsignore
assembly/lib corbaloc-1.0.jar
assembly/src/etc demo.mf project.mf
assembly/src/etc/activator client.xml server.xml
assembly/src/java/org/apache/excalibur/merlin/activation
DefaultRemoteResource.java
DefaultRemoteResourceFactory.java
DefaultRemoteResourceFactory.xinfo
DefaultServiceResolver.java
assembly/src/java/org/apache/excalibur/merlin/assembly
ContainerManager.java TypeManager.java
assembly/src/java/org/apache/excalibur/merlin/container
ContainerFactory.java
assembly/src/java/org/apache/excalibur/merlin/resource
DefaultResourceFactory.java
assembly/src/java/org/apache/excalibur/merlin/service
DefaultServiceManagementContext.java
Log:
Minor updates.
Revision Changes Path
1.12 +0 -1 jakarta-avalon-excalibur/assembly/.cvsignore
Index: .cvsignore
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/.cvsignore,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- .cvsignore 7 Sep 2002 07:27:10 -0000 1.11
+++ .cvsignore 7 Sep 2002 19:05:40 -0000 1.12
@@ -1,7 +1,6 @@
ant.properties
build
dist
-tools
checkstyle.cache
kernel.log
extensions
1.2 +15 -21 jakarta-avalon-excalibur/assembly/lib/corbaloc-1.0.jar
<<Binary file>>
1.4 +3 -0 jakarta-avalon-excalibur/assembly/src/etc/demo.mf
Index: demo.mf
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/etc/demo.mf,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- demo.mf 7 Sep 2002 07:27:10 -0000 1.3
+++ demo.mf 7 Sep 2002 19:05:40 -0000 1.4
@@ -30,3 +30,6 @@
Name: org/apache/excalibur/playground/activation/ActivationClient.class
Avalon: Type
+
+Name: org/apache/excalibur/playground/remote/TestServant.class
+Avalon: Type
1.17 +3 -0 jakarta-avalon-excalibur/assembly/src/etc/project.mf
Index: project.mf
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/etc/project.mf,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- project.mf 7 Sep 2002 07:27:10 -0000 1.16
+++ project.mf 7 Sep 2002 19:05:40 -0000 1.17
@@ -46,3 +46,6 @@
Name: org/apache/excalibur/merlin/activation/DefaultServiceResolver.class
Avalon: Type
+Name: org/apache/excalibur/merlin/activation/DefaultRemoteResourceFactory.class
+Avalon: Type
+
1.2 +2 -2 jakarta-avalon-excalibur/assembly/src/etc/activator/client.xml
Index: client.xml
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/etc/activator/client.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- client.xml 7 Sep 2002 07:27:10 -0000 1.1
+++ client.xml 7 Sep 2002 19:05:41 -0000 1.2
@@ -52,10 +52,10 @@
ORB service which will be resolved automatically.
-->
- <component name="client" class="org.apache.excalibur.playground.ActivationClient" activation="true">
+ <component name="client" class="org.apache.excalibur.playground.activation.ActivationClient" activation="true">
<categories priority="DEBUG"/>
<configuration>
- <connection url="corbaloc:iiop:1.2@home.osm.net:2056/activator"/>
+ <connection url="corbaloc:iiop:1.2@home.osm.net:2056/activator/servant"/>
</configuration>
</component>
1.2 +16 -2 jakarta-avalon-excalibur/assembly/src/etc/activator/server.xml
Index: server.xml
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/etc/activator/server.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- server.xml 7 Sep 2002 07:27:10 -0000 1.1
+++ server.xml 7 Sep 2002 19:05:41 -0000 1.2
@@ -44,7 +44,7 @@
</classpath>
<component name="orb" class="org.apache.orb.ORB" activation="true">
- <categories priority="DEBUG"/>
+ <categories priority="INFO"/>
<configuration>
<property name="iiop.port" value="2056"/>
<initializer class="org.openorb.adapter.fwd.ForwardInitializer" name="forward"/>
@@ -52,7 +52,21 @@
</component>
<container name="activator" class="org.apache.excalibur.merlin.activation.DefaultServiceResolver">
- <categories priority="INFO"/>
+
+ <categories priority="INFO">
+ <category priority="WARN" name="loader" />
+ </categories>
+
+ <classpath>
+ <fileset dir="build/lib">
+ <include name="demo.jar"/>
+ </fileset>
+ </classpath>
+
+ <component name="servant" class="org.apache.excalibur.playground.remote.TestServant">
+ <categories priority="DEBUG"/>
+ </component>
+
</container>
</container>
1.2 +45 -3 jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/activation/DefaultRemoteResource.java
Index: DefaultRemoteResource.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/activation/DefaultRemoteResource.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DefaultRemoteResource.java 7 Sep 2002 07:27:11 -0000 1.1
+++ DefaultRemoteResource.java 7 Sep 2002 19:05:41 -0000 1.2
@@ -19,9 +19,17 @@
import org.apache.orb.ORB;
+import org.omg.PortableServer.POA;
+import org.omg.PortableServer.Servant;
+import org.omg.PortableServer.IdAssignmentPolicyValue;
+import org.omg.PortableServer.LifespanPolicyValue;
+import org.omg.CORBA.Policy;
/**
- * Opaque type that maps a path to a profile.
+ * The <code>DefaultRemoteResource</code> is a resource implementation the
+ * provides support for the establishment of a CORBA object reference to
+ * a POA (PortableObjectAdapter) that is itself based on a component
+ * implementation.
*
* @author <a href="mailto:mcconnell@apache.org">Stephen McConnell</a>
* @version $Revision$ $Date$
@@ -38,10 +46,25 @@
private final ORB m_orb;
/**
+ * The root POA.
+ */
+ private POA m_root;
+
+ /**
+ * The application POA.
+ */
+ private POA m_poa;
+
+ /**
* A profile containing POA servant activation criteria.
*/
private final Profile m_profile;
+ /**
+ * The CORBA object reference.
+ */
+ private org.omg.CORBA.Object m_reference;
+
//==========================================================================
// constructor
//==========================================================================
@@ -76,13 +99,32 @@
*/
public org.omg.CORBA.Object getReference()
{
- return null;
+ if( m_reference == null )
+ {
+ try
+ {
+ m_reference = createObjectReference();
+ }
+ catch( Throwable e )
+ {
+ final String error =
+ "Unable to establish a POA for the profile: "
+ + m_profile.getName();
+ throw new ActivationRuntimeException( error, e );
+ }
+ }
+ return m_reference;
}
//==========================================================================
// implementation
//==========================================================================
+ private org.omg.CORBA.Object createObjectReference() throws Exception
+ {
+ m_root = (POA) m_orb.resolve_initial_references("RootPOA");
+ return null;
+ }
/**
* Returns a string representation of the resoruce.
1.2 +6 -2 jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/activation/DefaultRemoteResourceFactory.java
Index: DefaultRemoteResourceFactory.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/activation/DefaultRemoteResourceFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DefaultRemoteResourceFactory.java 7 Sep 2002 07:27:11 -0000 1.1
+++ DefaultRemoteResourceFactory.java 7 Sep 2002 19:05:41 -0000 1.2
@@ -10,6 +10,7 @@
package org.apache.excalibur.merlin.activation;
import org.apache.avalon.framework.context.Context;
+import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.avalon.framework.service.ServiceManager;
import org.apache.avalon.framework.service.ServiceException;
import org.apache.avalon.framework.service.Serviceable;
@@ -25,7 +26,7 @@
*
* @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
*/
-public class DefaultRemoteResourceFactory implements RemoteResourceFactory
+public class DefaultRemoteResourceFactory extends AbstractLogEnabled implements RemoteResourceFactory
{
private ORB m_orb;
@@ -76,6 +77,9 @@
throw new NullPointerException( "handler" );
}
- return new DefaultRemoteResource( manager, profile, context, handler, m_orb );
+ DefaultRemoteResource resource =
+ new DefaultRemoteResource( manager, profile, context, handler, m_orb );
+ resource.enableLogging( getLogger() );
+ return resource;
}
}
1.2 +1 -1 jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/activation/DefaultRemoteResourceFactory.xinfo
Index: DefaultRemoteResourceFactory.xinfo
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/activation/DefaultRemoteResourceFactory.xinfo,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DefaultRemoteResourceFactory.xinfo 7 Sep 2002 07:27:11 -0000 1.1
+++ DefaultRemoteResourceFactory.xinfo 7 Sep 2002 19:05:41 -0000 1.2
@@ -18,7 +18,7 @@
<services>
<service>
- <reference type="org.apache.excalibur.merlin.resource.RemoteResourceFactory" />
+ <reference type="org.apache.excalibur.merlin.activation.RemoteResourceFactory" />
</service>
</services>
1.2 +1 -3 jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/activation/DefaultServiceResolver.java
Index: DefaultServiceResolver.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/activation/DefaultServiceResolver.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DefaultServiceResolver.java 7 Sep 2002 07:27:11 -0000 1.1
+++ DefaultServiceResolver.java 7 Sep 2002 19:05:41 -0000 1.2
@@ -238,7 +238,6 @@
public void stop()
throws Exception
{
- super.stop();
try
{
m_poa.destroy( true, true );
@@ -250,6 +249,7 @@
getLogger().warn( "ignoring POA related exception" );
}
}
+ super.stop();
}
//=======================================================================
@@ -278,8 +278,6 @@
// the URI is refering to ourselves
//
- //Any any = m_orb.create_any();
- //ServiceResolverHelper.insert( any, m_resolver );
return m_resolver;
}
1.31 +14 -3 jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/assembly/ContainerManager.java
Index: ContainerManager.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/assembly/ContainerManager.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- ContainerManager.java 7 Sep 2002 07:27:11 -0000 1.30
+++ ContainerManager.java 7 Sep 2002 19:05:41 -0000 1.31
@@ -85,8 +85,6 @@
*/
public static final String LIFESTYLES_KEY = "lifestyles";
- private static final ResourceFactory c_resourceFactory = new DefaultResourceFactory();
-
//===================================================================
// state
//===================================================================
@@ -907,6 +905,13 @@
if( classname != null )
{
+
+ //
+ // handle the component factory as a classic component where
+ // the supplied classname is the service interface implemented by
+ // the factory component
+ //
+
Profile factoryProfile = getProfile(
new ReferenceDescriptor( classname ) );
@@ -936,6 +941,12 @@
}
else
{
+
+ //
+ // there is no custom factory declared so use the internal
+ // resource classes directly
+ //
+
Resource res;
if( profile instanceof ContainerDescriptor )
{
1.18 +1 -16 jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/assembly/TypeManager.java
Index: TypeManager.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/assembly/TypeManager.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- TypeManager.java 7 Sep 2002 07:27:11 -0000 1.17
+++ TypeManager.java 7 Sep 2002 19:05:41 -0000 1.18
@@ -222,32 +222,17 @@
File root = new File( System.getProperty( "user.dir" ) );
if( m_bootstrap )
{
- System.out.println("##### BOOTSTRAP " + m_extensions + " #####" );
String sep = System.getProperty("path.separator");
String classpath = System.getProperty("java.class.path");
- System.out.println("\tclasspath: " + classpath );
StringTokenizer tokenizer = new StringTokenizer( classpath, sep );
while( tokenizer.hasMoreTokens() )
{
String token = tokenizer.nextToken();
URL jar = new File( root, token ).toURL();
- System.out.println("\tcp-term: " + jar );
scan( jar );
}
-/*
- String ext = System.getProperty("java.ext.dirs").trim();
- System.out.println("\text: '" + ext + "'");
- tokenizer = new StringTokenizer( ext, sep );
- while( tokenizer.hasMoreTokens() )
- {
- String token = tokenizer.nextToken();
- URL extension = new File( root, token ).toURL();
- System.out.println("\ttoken: " + extension );
- scan( extension );
- }
-*/
m_bootstrap = false;
}
1.8 +5 -2 jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/container/ContainerFactory.java
Index: ContainerFactory.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/container/ContainerFactory.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ContainerFactory.java 7 Sep 2002 07:27:11 -0000 1.7
+++ ContainerFactory.java 7 Sep 2002 19:05:41 -0000 1.8
@@ -10,6 +10,7 @@
package org.apache.excalibur.merlin.container;
import org.apache.avalon.framework.context.Context;
+import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.excalibur.merlin.assembly.ContainerManager;
import org.apache.excalibur.merlin.resource.ResourceFactory;
import org.apache.excalibur.merlin.resource.LifestyleHandler;
@@ -22,7 +23,7 @@
*
* @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
*/
-public class ContainerFactory implements ResourceFactory
+public class ContainerFactory extends AbstractLogEnabled implements ResourceFactory
{
/**
* Creation of a new container resource.
@@ -57,7 +58,9 @@
throw new NullPointerException( "handler" );
}
- return new ContainerResource( manager, profile, context, handler );
+ ContainerResource resource = new ContainerResource( manager, profile, context, handler );
+ resource.enableLogging( getLogger() );
+ return resource;
}
}
1.2 +5 -2 jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/resource/DefaultResourceFactory.java
Index: DefaultResourceFactory.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/resource/DefaultResourceFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DefaultResourceFactory.java 7 Sep 2002 07:27:11 -0000 1.1
+++ DefaultResourceFactory.java 7 Sep 2002 19:05:41 -0000 1.2
@@ -9,6 +9,7 @@
*/
package org.apache.excalibur.merlin.resource;
+import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.avalon.framework.context.Context;
import org.apache.excalibur.merlin.assembly.ContainerManager;
import org.apache.excalibur.merlin.model.Profile;
@@ -20,7 +21,7 @@
*
* @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
*/
-public class DefaultResourceFactory implements ResourceFactory
+public class DefaultResourceFactory extends AbstractLogEnabled implements ResourceFactory
{
/**
* Creation of a new resource.
@@ -55,6 +56,8 @@
throw new NullPointerException( "handler" );
}
- return new DefaultResource( manager, profile, context, handler );
+ DefaultResource resource = new DefaultResource( manager, profile, context, handler );
+ resource.enableLogging( getLogger() );
+ return resource;
}
}
1.2 +2 -1 jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/service/DefaultServiceManagementContext.java
Index: DefaultServiceManagementContext.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/service/DefaultServiceManagementContext.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DefaultServiceManagementContext.java 7 Sep 2002 07:27:12 -0000 1.1
+++ DefaultServiceManagementContext.java 7 Sep 2002 19:05:41 -0000 1.2
@@ -189,6 +189,7 @@
public Resource locate( URI uri ) throws UnknownServiceException, InvalidPathException
{
URI path = m_base.relativize( uri );
+ System.out.println("## locating: '" + path + "'");
if( path.getPath().indexOf("/") > -1 )
{
//
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>