exported_ = false;
} else {
name_ = tmUniqueName + "UserTransactionServer";
providerUrl_ = properties.getProperty ( Context.PROVIDER_URL );
if ( providerUrl_ == null ) {
throw new SysException ( "Startup property "
+ Context.PROVIDER_URL
+ " must be set for client demarcation." );
}
initialContextFactory_ = properties
.getProperty ( Context.INITIAL_CONTEXT_FACTORY );
if ( initialContextFactory_ == null ) {
throw new SysException ( "Startup property "
+ Context.INITIAL_CONTEXT_FACTORY
+ " must be set for client demarcation." );
}
properties_ = properties;
tm_ = (TransactionManagerImp) TransactionManagerImp
.getTransactionManager ();
if ( tm_ == null )
throw new SysException ( "No TM found" );
try {
if ( "PortableRemoteObject".equals ( exportClass ) ) {
PortableRemoteObject.exportObject ( this );
exported_ = true;
} else if ( "UnicastRemoteObject".equals ( exportClass ) ) {
UnicastRemoteObject.exportObject ( this );
exported_ = true;
}
} catch ( Exception e ) {
Stack errors = new Stack ();
errors.push ( e );
throw new SysException (
"Error exporting - naming service not running?", errors );
}
try {
Context ctx = getInitialContext ();
ctx.rebind ( name_, this );
} catch ( Exception e ) {
Stack errors = new Stack ();
errors.push ( e );
throw new SysException (
"Please make sure the rmiregistry is running!?", errors );
}
}