mcconnell 02/05/11 20:17:15
Modified: enterprise/pss build.properties build.xml
enterprise/pss/src/java/org/apache/pss ConnectorContext.java
DefaultConnectorContext.java
DefaultSessionContext.java ORB.java ORB.xinfo
enterprise/pss/src/java/org/apache/pss/connector
BasePID.java
Log:
ganeral updates
Revision Changes Path
1.2 +3 -5 jakarta-avalon-apps/enterprise/pss/build.properties
Index: build.properties
===================================================================
RCS file: /home/cvs/jakarta-avalon-apps/enterprise/pss/build.properties,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- build.properties 28 Feb 2002 19:07:17 -0000 1.1
+++ build.properties 12 May 2002 03:17:14 -0000 1.2
@@ -5,9 +5,7 @@
# to related cornerstone resource
#
-orb.jar=openorb-1.2.2.jar
-idl.jar=openorb_tools-1.2.2.jar
-orb-manager.jar=orb-manager-1.0.1.jar
-ots.jar=openorb_ots-1.2.1.jar
-ots.jta.jar=jta_1.0.1.jar
+project.title=Persistent State Service (PSS)
+project.description=PSS implementation derived from on the 1.2.1 Community
OpenORB binary distribution.
+
1.3 +11 -11 jakarta-avalon-apps/enterprise/pss/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-avalon-apps/enterprise/pss/build.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- build.xml 12 Mar 2002 22:18:01 -0000 1.2
+++ build.xml 12 May 2002 03:17:14 -0000 1.3
@@ -1,9 +1,4 @@
-<!--
-PSS Service.
-Copyright 2001-2002 OSM SARL, All Rights Reserved.
--->
-
<project name="pss" default="help" basedir=".">
<property file="local.properties"/>
@@ -15,8 +10,8 @@
Description
-----------
- PSS implementation derived from on the 1.2.1 Community OpenORB
- binary distribution.
+ ${project.title}
+ ${project.description}
General Targets:
----------------
@@ -168,7 +163,11 @@
<target name="pss.build.context" depends="pss.context" >
<uptodate property="pss.uptodate" targetfile="${dist}/${pss.jar}">
<srcfiles dir="${idl}"/>
+ <srcfiles dir="${etc}">
+ <include name="**/**.*"/>
+ </srcfiles>
<srcfiles dir="${src}/java">
+ <include name="**/*"/>
<exclude name="org/apache/pss/compiler/**"/>
<exclude name="org/apache/pss/wrapper/**"/>
</srcfiles>
@@ -191,10 +190,11 @@
<copy todir="${build}/pss/lib">
<fileset dir="${src}/java">
<include name="org/apache/pss/config.xml"/>
- <include name="org/apache/pss/PSSServer.xinfo"/>
+ <include name="**/*.xinfo"/>
</fileset>
</copy>
- <jar jarfile="${dist}/${pss.jar}" basedir="${build}/pss/lib" />
+ <jar jarfile="${dist}/${pss.jar}" basedir="${build}/pss/lib"
+ manifest="${etc}/${ant.project.name}.mf"/>
</target>
<!-- PSDL COMPILATION TEST -->
@@ -288,11 +288,11 @@
</fileset>
</copy>
<javadoc destdir="${javadoc.root.path}"
- doctitle="<h1>Persistent State Service (PSS)</h1>"
+ doctitle="<h1>${project.title} ${VERSION}</h1>"
noindex="false" author="false"
use="true"
overview="${overview.html}"
- windowtitle="OSM Persistent State Service"
+ windowtitle="${project.title}"
bottom="<a href='[EMAIL PROTECTED]/LICENSE.HTML'/>License,
Disclaimer and due credits.</a>"
additionalparam="-breakiterator -J-Xmx128m"
packagenames="org.*" >
1.2 +3 -3
jakarta-avalon-apps/enterprise/pss/src/java/org/apache/pss/ConnectorContext.java
Index: ConnectorContext.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-apps/enterprise/pss/src/java/org/apache/pss/ConnectorContext.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ConnectorContext.java 28 Feb 2002 19:10:50 -0000 1.1
+++ ConnectorContext.java 12 May 2002 03:17:15 -0000 1.2
@@ -7,7 +7,7 @@
package org.apache.pss;
-import org.apache.orb.ORBContext;
+import org.apache.orb.POAContext;
import org.apache.avalon.framework.context.ContextException;
import org.omg.CORBA_2_3.ORB;
@@ -19,13 +19,13 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Stephen McConnell</a>
*/
-public interface ConnectorContext extends ORBContext
+public interface ConnectorContext extends POAContext
{
//=================================================================
// static
//=================================================================
- public static final String CONNECTOR_KEY = "CONNECTOR";
+ public static final String CONNECTOR_KEY = "CONNECTOR_KEY";
//=================================================================
// ConnectorContext
1.2 +33 -4
jakarta-avalon-apps/enterprise/pss/src/java/org/apache/pss/DefaultConnectorContext.java
Index: DefaultConnectorContext.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-apps/enterprise/pss/src/java/org/apache/pss/DefaultConnectorContext.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DefaultConnectorContext.java 28 Feb 2002 19:10:50 -0000 1.1
+++ DefaultConnectorContext.java 12 May 2002 03:17:15 -0000 1.2
@@ -8,10 +8,10 @@
package org.apache.pss;
import org.apache.orb.DefaultORBContext;
+import org.apache.avalon.framework.context.Context;
import org.apache.avalon.framework.context.ContextException;
-
-import org.omg.CosPersistentState.Parameter;
-import org.omg.CORBA_2_3.ORB;
+import org.apache.avalon.framework.CascadingRuntimeException;
+import org.omg.PortableServer.POA;
/**
* The <code>DefaultConnectorContext</code> class is Context class that
@@ -33,10 +33,19 @@
*/
public DefaultConnectorContext( ORB orb, Connector connector )
{
- super( orb );
+ this( orb, connector, null );
+ }
+
+ /**
+ * Creation of a new DefaultConnectorContext.
+ */
+ public DefaultConnectorContext( ORB orb, Connector connector, Context
parent )
+ {
+ super( orb, parent );
put( ConnectorContext.CONNECTOR_KEY, connector );
}
+
//=================================================================
// ConnectorContext
//=================================================================
@@ -51,4 +60,24 @@
return (Connector) get( ConnectorContext.CONNECTOR_KEY );
}
+ //=================================================================
+ // POAContext
+ //=================================================================
+
+ /**
+ * Returns the relative root POA.
+ * @return POA the root POA
+ */
+ public POA getPOA()
+ {
+ try
+ {
+ return (POA) getORB().resolve_initial_references("RootPOA");
+ }
+ catch( Throwable e )
+ {
+ throw new CascadingRuntimeException(
+ "Unexpected exception while resoplving POA", e );
+ }
+ }
}
1.2 +10 -2
jakarta-avalon-apps/enterprise/pss/src/java/org/apache/pss/DefaultSessionContext.java
Index: DefaultSessionContext.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-apps/enterprise/pss/src/java/org/apache/pss/DefaultSessionContext.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DefaultSessionContext.java 28 Feb 2002 19:10:50 -0000 1.1
+++ DefaultSessionContext.java 12 May 2002 03:17:15 -0000 1.2
@@ -8,10 +8,10 @@
package org.apache.pss;
import org.apache.orb.DefaultORBContext;
+import org.apache.avalon.framework.context.Context;
import org.apache.avalon.framework.context.ContextException;
import org.omg.CosPersistentState.Parameter;
-import org.omg.CORBA_2_3.ORB;
/**
* The <code>DefaultConnectorContext</code> class is Context class that
@@ -33,7 +33,15 @@
*/
public DefaultSessionContext( ORB orb, Connector connector, Session
session )
{
- super( orb, connector );
+ this( orb, connector, session, null );
+ }
+
+ /**
+ * Creation of a new DefaultConnectorContext.
+ */
+ public DefaultSessionContext( ORB orb, Connector connector, Session
session, Context parent )
+ {
+ super( orb, connector, parent );
put( SessionContext.SESSION_KEY, session );
}
1.2 +88 -1
jakarta-avalon-apps/enterprise/pss/src/java/org/apache/pss/ORB.java
Index: ORB.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-apps/enterprise/pss/src/java/org/apache/pss/ORB.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ORB.java 12 Mar 2002 22:23:30 -0000 1.1
+++ ORB.java 12 May 2002 03:17:15 -0000 1.2
@@ -7,6 +7,17 @@
package org.apache.pss;
+import org.apache.avalon.framework.configuration.Configurable;
+import org.apache.avalon.framework.configuration.Configuration;
+import org.apache.avalon.framework.configuration.ConfigurationException;
+import org.apache.avalon.framework.context.ContextException;
+import org.apache.avalon.framework.CascadingException;
+import org.apache.orb.ORBContext;
+import org.apache.orb.POAContext;
+
+import org.omg.CosPersistentState.ConnectorHelper;
+
+
/**
* The <code>ORB</code> class preconfigured with PSS services.
* <p><table border="1" cellpadding="3" cellspacing="0" width="100%">
@@ -28,6 +39,82 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Stephen McConnell</a>
*/
-public class ORB extends org.apache.orb.ORB
+public class ORB extends org.apache.orb.ORB implements ConnectorContext,
POAContext, ORBContext
{
+
+ private Configuration m_config;
+
+ private Connector m_connector;
+
+ private ConnectorContext m_connector_context;
+
+ //=======================================================================
+ // Configurable
+ //=======================================================================
+
+ public void configure( final Configuration config )
+ throws ConfigurationException
+ {
+ super.configure( config );
+
+ if( getLogger().isDebugEnabled() ) getLogger().debug( "configuration"
);
+ m_config = config.getChild("pss");
+ }
+
+ //=======================================================================
+ // Initializable
+ //=======================================================================
+
+ public void initialize()
+ throws Exception
+ {
+ super.initialize();
+
+ if( getLogger().isDebugEnabled() ) getLogger().debug(
"initialization (PSS ORB)" );
+
+ //
+ // create the PSS connector based on the configuration
+ //
+
+ try
+ {
+ String mode =
m_config.getChild("connector").getAttribute("value","file");
+ org.omg.CORBA.Object object = super.resolve_initial_references(
+ "PSS:APACHE:" + mode );
+ m_connector = (Connector) ConnectorHelper.narrow( object );
+ if( getLogger().isDebugEnabled() ) getLogger().debug(
+ "created PSS " + mode + " connector" );
+ m_connector_context = new DefaultConnectorContext( this,
m_connector );
+ }
+ catch( Throwable e )
+ {
+ String error = "Unexpected exception while creating PSS
connector.";
+ throw new CascadingException( error, e );
+ }
+ }
+
+ //=======================================================================
+ // ConnectorContext
+ //=======================================================================
+
+ /**
+ * Returns the PSS Connector.
+ * @return <code>Connector</code> the PSS persistentence system connector
+ */
+ public Connector getConnector( )
+ {
+ return m_connector;
+ }
+
+ public Object get( Object key ) throws ContextException
+ {
+ if( key.equals( ConnectorContext.CONNECTOR_KEY ) )
+ {
+ return m_connector;
+ }
+ else
+ {
+ return super.get( key );
+ }
+ }
}
1.2 +17 -2
jakarta-avalon-apps/enterprise/pss/src/java/org/apache/pss/ORB.xinfo
Index: ORB.xinfo
===================================================================
RCS file:
/home/cvs/jakarta-avalon-apps/enterprise/pss/src/java/org/apache/pss/ORB.xinfo,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ORB.xinfo 12 Mar 2002 22:23:30 -0000 1.1
+++ ORB.xinfo 12 May 2002 03:17:15 -0000 1.2
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!--
- File: ORBServer.xinfo
+ File: ORB.xinfo
License: etc/LICENSE.TXT
Copyright: Copyright (C) The Apache Software Foundation. All rights
reserved.
Copyright: OSM SARL 2001-2002, All Rights Reserved.
@@ -20,14 +20,29 @@
-->
<services>
- <service name="org.apache.orb.ORB" version="2.4" />
+ <service name="org.apache.pss.ORB" version="2.4" />
+ <service name="org.apache.pss.ConnectorContext" version="1.0" />
+ <service name="org.apache.orb.POAContext" version="1.0" />
+ <service name="org.apache.orb.ORBContext" version="1.0" />
</services>
<implementation policy="SINGLETON"/>
<configuration>
+
<initializer class="org.apache.pss.Initializer" name="pss"/>
+
+ <!--
+ The PSS connector configuration.
+ -->
+
+ <pss>
+ <connector value="file" />
+ </pss>
+
</configuration>
+
+ <implementation policy="SINGLETON"/>
</blockinfo>
1.2 +1 -3
jakarta-avalon-apps/enterprise/pss/src/java/org/apache/pss/connector/BasePID.java
Index: BasePID.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-apps/enterprise/pss/src/java/org/apache/pss/connector/BasePID.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- BasePID.java 28 Feb 2002 19:10:51 -0000 1.1
+++ BasePID.java 12 May 2002 03:17:15 -0000 1.2
@@ -356,8 +356,6 @@
public String toString()
{
- return getClass().getName() + "@" + System.identityHashCode( this )
+
- "\n\t catalog: '" + catalog_value_str() + "' " +
- "\n\t short: '" + short_value_str() + "' ";
+ return getClass().getName() + "@" + System.identityHashCode( this );
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>