Borland(R) Enterprise Server VisiBroker(R) デベロッパーズガイド
TraceWrapInit::update(int& argc, char* const* argv) { if (argc > 0) { init(argc, argv, "-TRACEWRAP"); VISObjectWrapper::Location loc; const char* propname; LIST(VISObjectWrapper:: UntypedObjectWrapperFactory_ptr) *list; for (CORBA::ULong i=0; i < 3; i++) { switch (i) { case 0: loc = VISObjectWrapper::Client; propname = "TRACEWRAPclient"; list = &_clientfacts; break; case 1: loc = VISObjectWrapper::Server; propname = "TRACEWRAPserver"; list = &_serverfacts; break; case 2: loc = VISObjectWrapper::Both; propname = "TRACEWRAPboth"; list = &_bothfacts; break; } CORBA::String_var getArgValue( property_value(propname)); if (arg && strlen(arg) > 0) { int numNew = atoi((char*) arg); char key_buf[256]; for (CORBA::ULong j=0; j < numNew; j++) { sprintf(key_buf, "%s-%d", propname, list->size()); list->add(new TraceObjectWrapperFactory(loc, (const char*) key_buf)); } } } } }
package UtilityObjectWrappers; import java.util.*; import com.inprise.vbroker.orb.ORB; import com.inprise.vbroker.properties.PropertyManager; import com.inprise.vbroker.interceptor.*; public class Init implements ServiceLoader { com.inprise.vbroker.orb.ORB _orb; public void init(final org.omg.CORBA.ORB orb) { _orb = (ORB) orb; PropertyManager pm= _orb.getPropertyManager(); try { ChainUntypedObjectWrapperFactory factory = ChainUntypedObjectWrapperFactoryHelper.narrow( orb.resolve_initial_references( "ChainUntypedObjectWrapperFactory")); // install my Timing ObjectWrapper String val = pm.getString("Timing", this.toString()); if( !val.equals(this.toString())) { UntypedObjectWrapperFactory f= new TimingUntypedObjectWrapperFactory(); if( val.equalsIgnoreCase("client") ) { factory.add(f, Location.CLIENT); } else if( val.equalsIgnoreCase("server") ) { factory.add(f, Location.SERVER); } else { factory.add(f, Location.BOTH); } } // install my Tracing ObjectWrapper val = pm.getString("Tracing", this.toString()); if( !val.equals(this.toString())) { UntypedObjectWrapperFactory f= new TracingUntypedObjectWrapperFactory(); if( val.equalsIgnoreCase("client") ) { factory.add(f, Location.CLIENT); } else if( val.equalsIgnoreCase("server") ) { factory.add(f, Location.SERVER); } else { factory.add(f, Location.BOTH); } } } catch( org.omg.CORBA.ORBPackage.InvalidName e ) { return; } } public void init_complete(org.omg.CORBA.ORB orb) {} public void shutdown(org.omg.CORBA.ORB orb) {} }
All Rights Reserved. Copyright (C) 2008, Hitachi, Ltd.
COPYRIGHT (C) 1992-2004 Borland Software Corporation. All rights reserved.