Skip to content

Commit f3300cf

Browse files
kalinchandmatej
authored andcommitted
Add option to skip gmbal init
1 parent 00e85ca commit f3300cf

File tree

6 files changed

+29
-10
lines changed

6 files changed

+29
-10
lines changed

orbmain/src/main/java/com/sun/corba/ee/impl/oa/poa/POAFactory.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ public void init( ORB orb )
180180
NullaryFunction.Factory.makeConstant(
181181
(org.omg.CORBA.Object)poaCurrent ) ) ;
182182
this.mom = orb.mom() ;
183-
mom.registerAtRoot( this ) ;
183+
if (mom != null) {
184+
mom.registerAtRoot( this ) ;
185+
}
184186
}
185187

186188
public ObjectAdapter find( ObjectAdapterId oaid )

orbmain/src/main/java/com/sun/corba/ee/impl/oa/poa/POAImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,9 @@ static POAFactory getPOAFactory( ORB orb )
316316

317317
@Poa
318318
private static void registerMBean( ORB orb, Object obj ) {
319-
orb.mom().register( getPOAFactory( orb ), obj ) ;
319+
if (orb.mom() != null) {
320+
orb.mom().register( getPOAFactory( orb ), obj ) ;
321+
}
320322
}
321323

322324
// package private so that POAFactory can access it.

orbmain/src/main/java/com/sun/corba/ee/impl/oa/toa/TOAFactory.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ public void init( ORB orb )
8181
this.orb = orb ;
8282
tom = new TransientObjectManager( orb ) ;
8383
codebaseToTOA = new HashMap<String,TOAImpl>() ;
84-
orb.mom().registerAtRoot( this ) ;
84+
if (orb.mom() != null) {
85+
orb.mom().registerAtRoot( this ) ;
86+
}
8587
}
8688

8789
public void shutdown( boolean waitForCompletion )

orbmain/src/main/java/com/sun/corba/ee/impl/orb/ORBImpl.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@
141141
import org.glassfish.pfl.basic.contain.ResourceFactory;
142142
import org.glassfish.pfl.basic.func.NullaryFunction;
143143
import org.glassfish.pfl.tf.spi.annotation.InfoMethod;
144-
144+
145+
import static com.sun.corba.ee.spi.misc.ORBConstants.SKIP_GMBAL_INIT;
146+
145147
/**
146148
* The JavaIDL ORB implementation.
147149
*/
@@ -550,7 +552,9 @@ private void postInit( String[] params, DataCollector dataCollector ) {
550552
setDebugFlags( configData.getORBDebugFlags() ) ;
551553
configDataParsingComplete( getORBData().getORBId() ) ;
552554

553-
initManagedObjectManager() ;
555+
if (!Boolean.parseBoolean(System.getProperty(SKIP_GMBAL_INIT, "false"))) {
556+
initManagedObjectManager() ;
557+
}
554558

555559
// The TimerManager must be
556560
// initialized BEFORE the pihandler.initialize() call, in
@@ -618,8 +622,10 @@ private void postInit( String[] params, DataCollector dataCollector ) {
618622

619623
// Now the ORB is ready, so finish all of the MBean registration
620624
if (configData.registerMBeans()) {
621-
mom.resumeJMXRegistration() ;
622-
mbeansRegistereed( getORBData().getORBId() ) ;
625+
if (mom != null) {
626+
mom.resumeJMXRegistration() ;
627+
mbeansRegistereed( getORBData().getORBId() ) ;
628+
}
623629
}
624630
}
625631

orbmain/src/main/java/com/sun/corba/ee/impl/transport/TransportManagerImpl.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ public TransportManagerImpl(ORB orb)
7373
outboundConnectionCaches = new HashMap<String,OutboundConnectionCache>();
7474
inboundConnectionCaches = new HashMap<String,InboundConnectionCache>();
7575
selector = new SelectorImpl(orb);
76-
orb.mom().register( orb, this ) ;
76+
if (orb.mom() != null) {
77+
orb.mom().register( orb, this ) ;
78+
}
7779
}
7880

7981
public ByteBufferPool getByteBufferPool(int id)
@@ -99,7 +101,9 @@ public OutboundConnectionCache getOutboundConnectionCache(
99101

100102
// We need to clean up the multi-cache support:
101103
// this really only works with a single cache.
102-
orb.mom().register( this, connectionCache ) ;
104+
if (orb.mom() != null) {
105+
orb.mom().register( this, connectionCache ) ;
106+
}
103107
StatsProviderManager.register( "orb", PluginPoint.SERVER,
104108
"orb/transport/connectioncache/outbound", connectionCache ) ;
105109

@@ -139,7 +143,9 @@ public InboundConnectionCache getInboundConnectionCache(
139143
connectionCache =
140144
new InboundConnectionCacheImpl(orb,
141145
acceptor);
142-
orb.mom().register( this, connectionCache ) ;
146+
if (orb.mom() != null) {
147+
orb.mom().register( this, connectionCache ) ;
148+
}
143149
StatsProviderManager.register( "orb", PluginPoint.SERVER,
144150
"orb/transport/connectioncache/inbound", connectionCache ) ;
145151

orbmain/src/main/java/com/sun/corba/ee/spi/misc/ORBConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ public static int makePersistent( int scid )
181181
public static final String SERVER_PORT_PROPERTY = SUN_PREFIX + "ORBServerPort" ;
182182
public static final String SERVER_HOST_PROPERTY = SUN_PREFIX + "ORBServerHost" ;
183183
public static final String ORB_ID_PROPERTY = CORBA_PREFIX + "ORBId" ;
184+
public static final String SKIP_GMBAL_INIT = CORBA_PREFIX + "SkipGmbalInit" ;
184185
// This property is provided for backward compatibility reasons
185186
public static final String OLD_ORB_ID_PROPERTY = SUN_PREFIX + "ORBid" ;
186187
public static final String ORB_SERVER_ID_PROPERTY = CORBA_PREFIX + "ORBServerId" ;

0 commit comments

Comments
 (0)