Return-Path: Delivered-To: apmail-jakarta-avalon-cvs-archive@apache.org Received: (qmail 91868 invoked from network); 12 May 2002 03:17:20 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 12 May 2002 03:17:20 -0000 Received: (qmail 11878 invoked by uid 97); 12 May 2002 03:17:30 -0000 Delivered-To: qmlist-jakarta-archive-avalon-cvs@jakarta.apache.org Received: (qmail 11825 invoked by uid 97); 12 May 2002 03:17:29 -0000 Mailing-List: contact avalon-cvs-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon CVS List" Reply-To: "Avalon Developers List" Delivered-To: mailing list avalon-cvs@jakarta.apache.org Received: (qmail 11811 invoked by uid 97); 12 May 2002 03:17:28 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 12 May 2002 03:17:15 -0000 Message-ID: <20020512031715.81252.qmail@icarus.apache.org> From: mcconnell@apache.org To: jakarta-avalon-apps-cvs@apache.org Subject: cvs commit: jakarta-avalon-apps/enterprise/pss/src/java/org/apache/pss/connector BasePID.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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 @@ - - @@ -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 @@ + + + + @@ -191,10 +190,11 @@ - + - + @@ -288,11 +288,11 @@ 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 Stephen McConnell */ -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 DefaultConnectorContext 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 DefaultConnectorContext 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 ORB class preconfigured with PSS services. *

@@ -28,6 +39,82 @@ * @author Stephen McConnell */ -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 Connector 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 @@ - + + + + + + + + + + + + + + 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: For additional commands, e-mail: