下面列出了怎么用org.omg.CORBA.INTERNAL的API类实例代码及写法,或者点击链接到github查看源代码。
public static BufferManagerWrite newBufferManagerWrite(
int strategy, byte encodingVersion, ORB orb) {
if (encodingVersion != Message.CDR_ENC_VERSION) {
if (strategy != BufferManagerFactory.GROW) {
ORBUtilSystemException wrapper =
ORBUtilSystemException.get((ORB)orb,
CORBALogDomains.RPC_ENCODING);
throw wrapper.invalidBuffMgrStrategy("newBufferManagerWrite");
}
return new BufferManagerWriteGrow(orb);
}
switch (strategy) {
case BufferManagerFactory.GROW:
return new BufferManagerWriteGrow(orb);
case BufferManagerFactory.COLLECT:
return new BufferManagerWriteCollect(orb);
case BufferManagerFactory.STREAM:
return new BufferManagerWriteStream(orb);
default:
throw new INTERNAL("Unknown buffer manager write strategy: "
+ strategy);
}
}
public INTERNAL errorSetLongField( CompletionStatus cs, Throwable t, Object arg0, Object arg1, Object arg2) {
INTERNAL exc = new INTERNAL( ERROR_SET_LONG_FIELD, cs ) ;
if (t != null)
exc.initCause( t ) ;
if (logger.isLoggable( Level.WARNING )) {
Object[] parameters = new Object[3] ;
parameters[0] = arg0 ;
parameters[1] = arg1 ;
parameters[2] = arg2 ;
doLog( Level.WARNING, "UTIL.errorSetLongField",
parameters, UtilSystemException.class, exc ) ;
}
return exc ;
}
public INTERNAL errorSetCharField( CompletionStatus cs, Throwable t, Object arg0, Object arg1, Object arg2) {
INTERNAL exc = new INTERNAL( ERROR_SET_CHAR_FIELD, cs ) ;
if (t != null)
exc.initCause( t ) ;
if (logger.isLoggable( Level.WARNING )) {
Object[] parameters = new Object[3] ;
parameters[0] = arg0 ;
parameters[1] = arg1 ;
parameters[2] = arg2 ;
doLog( Level.WARNING, "UTIL.errorSetCharField",
parameters, UtilSystemException.class, exc ) ;
}
return exc ;
}
public INTERNAL errorSetByteField( CompletionStatus cs, Throwable t, Object arg0, Object arg1, Object arg2) {
INTERNAL exc = new INTERNAL( ERROR_SET_BYTE_FIELD, cs ) ;
if (t != null)
exc.initCause( t ) ;
if (logger.isLoggable( Level.WARNING )) {
Object[] parameters = new Object[3] ;
parameters[0] = arg0 ;
parameters[1] = arg1 ;
parameters[2] = arg2 ;
doLog( Level.WARNING, "UTIL.errorSetByteField",
parameters, UtilSystemException.class, exc ) ;
}
return exc ;
}
public static BufferManagerRead newBufferManagerRead(
GIOPVersion version, byte encodingVersion, ORB orb) {
// REVISIT - On the reading side, shouldn't we monitor the incoming
// fragments on a given connection to determine what fragment size
// they're using, then use that ourselves?
if (encodingVersion != Message.CDR_ENC_VERSION) {
return new BufferManagerReadGrow(orb);
}
switch (version.intValue())
{
case GIOPVersion.VERSION_1_0:
return new BufferManagerReadGrow(orb);
case GIOPVersion.VERSION_1_1:
case GIOPVersion.VERSION_1_2:
// The stream reader can handle fragmented and
// non fragmented messages
return new BufferManagerReadStream(orb);
default:
// REVISIT - what is appropriate?
throw new INTERNAL("Unknown GIOP version: "
+ version);
}
}
public synchronized LegacyServerSocketEndPointInfo legacyGetEndpoint(
String name)
{
Iterator iterator = getAcceptorIterator();
while (iterator.hasNext()) {
LegacyServerSocketEndPointInfo endPoint = cast(iterator.next());
if (endPoint != null && name.equals(endPoint.getName())) {
return endPoint;
}
}
throw new INTERNAL("No acceptor for: " + name);
}
public INTERNAL exceptionUnavailable( CompletionStatus cs, Throwable t ) {
INTERNAL exc = new INTERNAL( EXCEPTION_UNAVAILABLE, cs ) ;
if (t != null)
exc.initCause( t ) ;
if (logger.isLoggable( Level.WARNING )) {
Object[] parameters = null ;
doLog( Level.WARNING, "INTERCEPTORS.exceptionUnavailable",
parameters, InterceptorsSystemException.class, exc ) ;
}
return exc ;
}
public INTERNAL nullPoa( CompletionStatus cs, Throwable t ) {
INTERNAL exc = new INTERNAL( NULL_POA, cs ) ;
if (t != null)
exc.initCause( t ) ;
if (logger.isLoggable( Level.WARNING )) {
Object[] parameters = null ;
doLog( Level.WARNING, "IOR.nullPoa",
parameters, IORSystemException.class, exc ) ;
}
return exc ;
}
public synchronized LegacyServerSocketEndPointInfo legacyGetEndpoint(
String name)
{
Iterator iterator = getAcceptorIterator();
while (iterator.hasNext()) {
LegacyServerSocketEndPointInfo endPoint = cast(iterator.next());
if (endPoint != null && name.equals(endPoint.getName())) {
return endPoint;
}
}
throw new INTERNAL("No acceptor for: " + name);
}
public INTERNAL cantPopOnlyPicurrent( CompletionStatus cs, Throwable t ) {
INTERNAL exc = new INTERNAL( CANT_POP_ONLY_PICURRENT, cs ) ;
if (t != null)
exc.initCause( t ) ;
if (logger.isLoggable( Level.WARNING )) {
Object[] parameters = null ;
doLog( Level.WARNING, "INTERCEPTORS.cantPopOnlyPicurrent",
parameters, InterceptorsSystemException.class, exc ) ;
}
return exc ;
}
/**
* Destroys this BindingIterator by disconnecting from the ORB
* @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions.
*/
final public void Destroy()
{
// Remove the object from the Active Object Map.
try {
byte[] objectId = biPOA.servant_to_id( this );
if( objectId != null ) {
biPOA.deactivate_object( objectId );
}
}
catch( Exception e ) {
throw new INTERNAL( "Exception in BindingIterator.Destroy " + e );
}
}
public INTERNAL namingCtxRebindAlreadyBound( CompletionStatus cs, Throwable t ) {
INTERNAL exc = new INTERNAL( NAMING_CTX_REBIND_ALREADY_BOUND, cs ) ;
if (t != null)
exc.initCause( t ) ;
if (logger.isLoggable( Level.WARNING )) {
Object[] parameters = null ;
doLog( Level.WARNING, "NAMING.namingCtxRebindAlreadyBound",
parameters, NamingSystemException.class, exc ) ;
}
return exc ;
}
public INTERNAL serverNotRunning( CompletionStatus cs, Throwable t ) {
INTERNAL exc = new INTERNAL( SERVER_NOT_RUNNING, cs ) ;
if (t != null)
exc.initCause( t ) ;
if (logger.isLoggable( Level.WARNING )) {
Object[] parameters = null ;
doLog( Level.WARNING, "ACTIVATION.serverNotRunning",
parameters, ActivationSystemException.class, exc ) ;
}
return exc ;
}
public INTERNAL namingCtxBadBindingtype( CompletionStatus cs, Throwable t ) {
INTERNAL exc = new INTERNAL( NAMING_CTX_BAD_BINDINGTYPE, cs ) ;
if (t != null)
exc.initCause( t ) ;
if (logger.isLoggable( Level.WARNING )) {
Object[] parameters = null ;
doLog( Level.WARNING, "NAMING.namingCtxBadBindingtype",
parameters, NamingSystemException.class, exc ) ;
}
return exc ;
}
public INTERNAL namingCtxResolveCannotNarrowToCtx( CompletionStatus cs, Throwable t ) {
INTERNAL exc = new INTERNAL( NAMING_CTX_RESOLVE_CANNOT_NARROW_TO_CTX, cs ) ;
if (t != null)
exc.initCause( t ) ;
if (logger.isLoggable( Level.WARNING )) {
Object[] parameters = null ;
doLog( Level.WARNING, "NAMING.namingCtxResolveCannotNarrowToCtx",
parameters, NamingSystemException.class, exc ) ;
}
return exc ;
}
public INTERNAL policyMediatorBadPolicyInFactory( CompletionStatus cs, Throwable t ) {
INTERNAL exc = new INTERNAL( POLICY_MEDIATOR_BAD_POLICY_IN_FACTORY, cs ) ;
if (t != null)
exc.initCause( t ) ;
if (logger.isLoggable( Level.WARNING )) {
Object[] parameters = null ;
doLog( Level.WARNING, "POA.policyMediatorBadPolicyInFactory",
parameters, POASystemException.class, exc ) ;
}
return exc ;
}
public INTERNAL preinvokePoaDestroyed( CompletionStatus cs, Throwable t ) {
INTERNAL exc = new INTERNAL( PREINVOKE_POA_DESTROYED, cs ) ;
if (t != null)
exc.initCause( t ) ;
if (logger.isLoggable( Level.WARNING )) {
Object[] parameters = null ;
doLog( Level.WARNING, "POA.preinvokePoaDestroyed",
parameters, POASystemException.class, exc ) ;
}
return exc ;
}
public INTERNAL pmfCreateRetain( CompletionStatus cs, Throwable t ) {
INTERNAL exc = new INTERNAL( PMF_CREATE_RETAIN, cs ) ;
if (t != null)
exc.initCause( t ) ;
if (logger.isLoggable( Level.WARNING )) {
Object[] parameters = null ;
doLog( Level.WARNING, "POA.pmfCreateRetain",
parameters, POASystemException.class, exc ) ;
}
return exc ;
}
public INTERNAL transNcNewctxGotExc( CompletionStatus cs, Throwable t ) {
INTERNAL exc = new INTERNAL( TRANS_NC_NEWCTX_GOT_EXC, cs ) ;
if (t != null)
exc.initCause( t ) ;
if (logger.isLoggable( Level.WARNING )) {
Object[] parameters = null ;
doLog( Level.WARNING, "NAMING.transNcNewctxGotExc",
parameters, NamingSystemException.class, exc ) ;
}
return exc ;
}
public INTERNAL xaRmfail( CompletionStatus cs, Throwable t ) {
INTERNAL exc = new INTERNAL( XA_RMFAIL, cs ) ;
if (t != null)
exc.initCause( t ) ;
if (logger.isLoggable( Level.WARNING )) {
Object[] parameters = null ;
doLog( Level.WARNING, "OMG.xaRmfail",
parameters, OMGSystemException.class, exc ) ;
}
return exc ;
}
public INTERNAL servantDispatch( CompletionStatus cs, Throwable t ) {
INTERNAL exc = new INTERNAL( SERVANT_DISPATCH, cs ) ;
if (t != null)
exc.initCause( t ) ;
if (logger.isLoggable( Level.WARNING )) {
Object[] parameters = null ;
doLog( Level.WARNING, "POA.servantDispatch",
parameters, POASystemException.class, exc ) ;
}
return exc ;
}
public INTERNAL insBadSchemeSpecificPart( CompletionStatus cs, Throwable t ) {
INTERNAL exc = new INTERNAL( INS_BAD_SCHEME_SPECIFIC_PART, cs ) ;
if (t != null)
exc.initCause( t ) ;
if (logger.isLoggable( Level.WARNING )) {
Object[] parameters = null ;
doLog( Level.WARNING, "NAMING.insBadSchemeSpecificPart",
parameters, NamingSystemException.class, exc ) ;
}
return exc ;
}
public INTERNAL poaInternalGetServantError( CompletionStatus cs, Throwable t ) {
INTERNAL exc = new INTERNAL( POA_INTERNAL_GET_SERVANT_ERROR, cs ) ;
if (t != null)
exc.initCause( t ) ;
if (logger.isLoggable( Level.WARNING )) {
Object[] parameters = null ;
doLog( Level.WARNING, "POA.poaInternalGetServantError",
parameters, POASystemException.class, exc ) ;
}
return exc ;
}
public INTERNAL insOther( CompletionStatus cs, Throwable t ) {
INTERNAL exc = new INTERNAL( INS_OTHER, cs ) ;
if (t != null)
exc.initCause( t ) ;
if (logger.isLoggable( Level.WARNING )) {
Object[] parameters = null ;
doLog( Level.WARNING, "NAMING.insOther",
parameters, NamingSystemException.class, exc ) ;
}
return exc ;
}
public INTERNAL makeFactoryNotPoa( CompletionStatus cs, Throwable t, Object arg0) {
INTERNAL exc = new INTERNAL( MAKE_FACTORY_NOT_POA, cs ) ;
if (t != null)
exc.initCause( t ) ;
if (logger.isLoggable( Level.WARNING )) {
Object[] parameters = new Object[1] ;
parameters[0] = arg0 ;
doLog( Level.WARNING, "POA.makeFactoryNotPoa",
parameters, POASystemException.class, exc ) ;
}
return exc ;
}
public INTERNAL invokesetup( CompletionStatus cs, Throwable t ) {
INTERNAL exc = new INTERNAL( INVOKESETUP, cs ) ;
if (t != null)
exc.initCause( t ) ;
if (logger.isLoggable( Level.WARNING )) {
Object[] parameters = null ;
doLog( Level.WARNING, "POA.invokesetup",
parameters, POASystemException.class, exc ) ;
}
return exc ;
}
private void run(String[] args)
{
try {
// parse the args and try setting the values for these
// properties
processArgs(args);
ORB orb = createORB(args);
if (orb.orbdDebugFlag)
System.out.println( "ORBD begins initialization." ) ;
boolean firstRun = createSystemDirs( ORBConstants.DEFAULT_DB_DIR );
startActivationObjects(orb);
if (firstRun) // orbd is being run the first time
installOrbServers(getRepository(), getActivator());
if (orb.orbdDebugFlag) {
System.out.println( "ORBD is ready." ) ;
System.out.println("ORBD serverid: " +
System.getProperty(ORBConstants.SERVER_ID_PROPERTY));
System.out.println("activation dbdir: " +
System.getProperty(ORBConstants.DB_DIR_PROPERTY));
System.out.println("activation port: " +
System.getProperty(ORBConstants.ORBD_PORT_PROPERTY));
String pollingTime = System.getProperty(
ORBConstants.SERVER_POLLING_TIME);
if( pollingTime == null ) {
pollingTime = Integer.toString(
ORBConstants.DEFAULT_SERVER_POLLING_TIME );
}
System.out.println("activation Server Polling Time: " +
pollingTime + " milli-seconds ");
String startupDelay = System.getProperty(
ORBConstants.SERVER_STARTUP_DELAY);
if( startupDelay == null ) {
startupDelay = Integer.toString(
ORBConstants.DEFAULT_SERVER_STARTUP_DELAY );
}
System.out.println("activation Server Startup Delay: " +
startupDelay + " milli-seconds " );
}
// The following two lines start the Persistent NameService
NameServiceStartThread theThread =
new NameServiceStartThread( orb, dbDir );
theThread.start( );
orb.run();
} catch( org.omg.CORBA.COMM_FAILURE cex ) {
System.out.println( CorbaResourceUtil.getText("orbd.commfailure"));
System.out.println( cex );
cex.printStackTrace();
} catch( org.omg.CORBA.INTERNAL iex ) {
System.out.println( CorbaResourceUtil.getText(
"orbd.internalexception"));
System.out.println( iex );
iex.printStackTrace();
} catch (Exception ex) {
System.out.println(CorbaResourceUtil.getText(
"orbd.usage", "orbd"));
System.out.println( ex );
ex.printStackTrace();
}
}
public INTERNAL exceptionWasNull2( ) {
return exceptionWasNull2( CompletionStatus.COMPLETED_NO, null ) ;
}
public INTERNAL xaRmerr( ) {
return xaRmerr( CompletionStatus.COMPLETED_NO, null ) ;
}
public INTERNAL nullPoa( CompletionStatus cs ) {
return nullPoa( cs, null ) ;
}