Borland(R) Enterprise Server VisiBroker(R) デベロッパーズガイド
. . . static const CORBA::ULong kNumTypedAccountProps = 2; static PropStruct TypedAccountProps[kNumTypedAccountProps] = { { "BANKaccountCacheClnt", CachingAccountObjectWrapper::factory, VISObjectWrapper::Client }, { "BANKaccountCacheSrvr", CachingAccountObjectWrapper::factory, VISObjectWrapper::Server } }; static const CORBA::ULong kNumTypedAccountManagerProps = 4; static PropStruct TypedAccountManagerProps[ kNumTypedAccountManagerProps] = { { "BANKmanagerCacheClnt", CachingAccountManagerObjectWrapper::factory, VISObjectWrapper::Client }, { "BANKmanagerSecurityClnt", SecureAccountManagerObjectWrapper::factory, VISObjectWrapper::Client }, { "BANKmanagerCacheSrvr", CachingAccountManagerObjectWrapper::factory, VISObjectWrapper::Server }, { "BANKmanagerSecuritySrvr", SecureAccountManagerObjectWrapper::factory, VISObjectWrapper::Server }, }; void BankInit::update(int& argc, char* const* argv) { if (argc > 0) { init(argc, argv, "-BANK"); CORBA::ULong i; for (i=0; i < kNumTypedAccountProps; i++) { CORBA::String_var arg( getArgValue(TypedAccountProps[i].propname)); if (arg && strlen(arg) > 0) { if (atoi((char*) arg)) { Bank::AccountObjectWrapper::add(_orb, TypedAccountProps[i].fact, TypedAccountProps[i].loc); } else { Bank::AccountObjectWrapper::remove(_orb, TypedAccountProps[i].fact, TypedAccountProps[i].loc); } } } for (i=0; i < kNumTypedAccountManagerProps; i++) { CORBA::String_var arg( getArgValue( TypedAccountManagerProps[i].propname)); if (arg && strlen(arg) > 0 ) { if (atoi((char*) arg)) { Bank::AccountManagerObjectWrapper ::add(_orb, TypedAccountManagerProps[i].fact, TypedAccountManagerProps[i].loc); } else { Bank::AccountManagerObjectWrapper ::remove(_orb, TypedAccountManagerProps[i].fact, TypedAccountManagerProps[i].loc); } } } } }
package BankWrappers; 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(); // install my CachingAccountObjectWrapper String val = pm.getString("CachingAccount", this.toString()); Class c = CachingAccountObjectWrapper.class; if( !val.equals(this.toString())) { if( val.equalsIgnoreCase("client") ) { Bank.AccountHelper. addClientObjectWrapperClass(orb, c); } else if( val.equalsIgnoreCase("server") ) { Bank.AccountHelper. addServerObjectWrapperClass(orb, c); } else { Bank.AccountHelper. addClientObjectWrapperClass(orb, c); Bank.AccountHelper. addServerObjectWrapperClass(orb, c); } } // install my CachingAccountManagerObjectWrapper val = pm.getString("CachingAccountManager", this.toString()); c = CachingAccountManagerObjectWrapper.class; if( !val.equals(this.toString())) { if( val.equalsIgnoreCase("client") ) { Bank.AccountManagerHelper. addClientObjectWrapperClass(orb, c); } else if( val.equalsIgnoreCase("server") ) { Bank.AccountManagerHelper. addServerObjectWrapperClass(orb, c); } else { Bank.AccountManagerHelper. addClientObjectWrapperClass(orb, c); Bank.AccountManagerHelper. addServerObjectWrapperClass(orb, c); } } // install my CachingAccountManagerObjectWrapper val = pm.getString("SecureAccountManager", this.toString()); c = SecureAccountManagerObjectWrapper.class; if( !val.equals(this.toString())) { if( val.equalsIgnoreCase("client") ) { Bank.AccountManagerHelper. addClientObjectWrapperClass(orb, c); } else if( val.equalsIgnoreCase("server") ) { Bank.AccountManagerHelper. addServerObjectWrapperClass(orb, c); } else { Bank.AccountManagerHelper. addClientObjectWrapperClass(orb, c); Bank.AccountManagerHelper. addServerObjectWrapperClass(orb, c); } } } public void init_complete(org.omg.CORBA.ORB orb) {} public void shutdown(org.omg.CORBA.ORB orb) {} }
All Rights Reserved. Copyright (C) 2006, Hitachi, Ltd.
COPYRIGHT (C) 1992-2004 Borland Software Corporation. All rights reserved.