⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 parsertable.java

📁 Mobile 应用程序使用 Java Micro Edition (Java ME) 平台
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
	Operation op = new Operation() {	    public Object operate( Object value ) 	    {		String param = (String)value ;		try {		    Class iiopPrimaryToContactInfoClass = ORBClassLoader.loadClass(param);		    // For security reasons avoid creating an instance if		    // this socket factory class is not one that would fail		    // the class cast anyway.		    if (IIOPPrimaryToContactInfo.class.isAssignableFrom(iiopPrimaryToContactInfoClass)) {			return iiopPrimaryToContactInfoClass.newInstance();		    } else {			throw wrapper.illegalIiopPrimaryToContactInfoType( iiopPrimaryToContactInfoClass.toString() ) ;		    }		} catch (Exception ex) {		    // ClassNotFoundException, IllegalAccessException, 		    // InstantiationException, SecurityException or 		    // ClassCastException		    throw wrapper.badCustomIiopPrimaryToContactInfo( ex, param ) ;		}	    }	} ;	return op ;    }        private Operation makeContactInfoListFactoryOperation()    {	Operation op = new Operation() {	    public Object operate( Object value ) 	    {		String param = (String)value ;		try {		    Class contactInfoListFactoryClass =			ORBClassLoader.loadClass(param);		    // For security reasons avoid creating an instance if		    // this socket factory class is not one that would fail		    // the class cast anyway.		    if (CorbaContactInfoListFactory.class.isAssignableFrom(			contactInfoListFactoryClass)) {			return contactInfoListFactoryClass.newInstance();		    } else {			throw wrapper.illegalContactInfoListFactoryType(                            contactInfoListFactoryClass.toString() ) ;		    }		} catch (Exception ex) {		    // ClassNotFoundException, IllegalAccessException, 		    // InstantiationException, SecurityException or 		    // ClassCastException		    throw wrapper.badContactInfoListFactory( ex, param ) ;		}	    }	} ;	return op ;    }        private Operation makeCSOperation()    {	Operation csop = new Operation() {	    public Object operate( Object value )	    {		String val = (String)value ;		return CodeSetComponentInfo.createFromString( val ) ;	    }	} ;	return csop ;    }    private Operation makeADOperation()    {	Operation admap = new Operation() {	    private Integer[] map = { 		new Integer( KeyAddr.value ), 		new Integer( ProfileAddr.value ), 		new Integer( ReferenceAddr.value ),		new Integer( KeyAddr.value ) } ;	    public Object operate( Object value ) 	    {		int val = ((Integer)value).intValue() ;		return map[val] ;	    }	} ;	Operation rangeop = OperationFactory.integerRangeAction( 0, 3 ) ;	Operation op1 = OperationFactory.compose( rangeop, admap ) ;	Operation result = OperationFactory.compose( op1, OperationFactory.convertIntegerToShort() ) ;	return result ;    }    private Operation makeFSOperation() {	Operation fschecker = new Operation() {	    public Object operate( Object value ) 	    {		int giopFragmentSize = ((Integer)value).intValue() ;		if (giopFragmentSize < ORBConstants.GIOP_FRAGMENT_MINIMUM_SIZE){		    throw wrapper.fragmentSizeMinimum( new Integer( giopFragmentSize ),			new Integer( ORBConstants.GIOP_FRAGMENT_MINIMUM_SIZE ) ) ;		}                if (giopFragmentSize % ORBConstants.GIOP_FRAGMENT_DIVISOR != 0)		    throw wrapper.fragmentSizeDiv( new Integer( giopFragmentSize ),			    new Integer( ORBConstants.GIOP_FRAGMENT_DIVISOR ) ) ;		return value ;	    }	} ;	Operation result = OperationFactory.compose( OperationFactory.integerAction(), 	    fschecker ) ;	return result ;    }    private Operation makeGVOperation() {	Operation gvHelper = OperationFactory.listAction( ".",	    OperationFactory.integerAction() ) ;	Operation gvMain = new Operation() {	    public Object operate( Object value )	    {		Object[] nums = (Object[])value ;		int major = ((Integer)(nums[0])).intValue() ;		int minor = ((Integer)(nums[1])).intValue() ;		return new GIOPVersion( major, minor ) ;	    } 	} ;		Operation result = OperationFactory.compose( gvHelper, gvMain ); 	return result ;    }    public static final class TestORBInitializer1 extends org.omg.CORBA.LocalObject 	implements ORBInitializer     {	public boolean equals( Object other )	{	    return other instanceof TestORBInitializer1 ;	}	public void pre_init( ORBInitInfo info ) 	{	}	public void post_init( ORBInitInfo info ) 	{	}    }    public static final class TestORBInitializer2 extends org.omg.CORBA.LocalObject	implements ORBInitializer     {	public boolean equals( Object other )	{	    return other instanceof TestORBInitializer2 ;	}	public void pre_init( ORBInitInfo info ) 	{	}	public void post_init( ORBInitInfo info ) 	{	}    }    private Operation makeROIOperation() {	Operation clsop = OperationFactory.classAction() ;	Operation indexOp = OperationFactory.suffixAction() ;	Operation op1 = OperationFactory.compose( indexOp, clsop ) ;	Operation mop = OperationFactory.maskErrorAction( op1 ) ;	Operation mkinst = new Operation() {	    public Object operate( Object value )	    {		final Class initClass = (Class)value ;		if (initClass == null)		    return null ;		// For security reasons avoid creating an instance 		// if this class is one that would fail the class cast 		// to ORBInitializer anyway.		if( org.omg.PortableInterceptor.ORBInitializer.class.isAssignableFrom( 		    initClass ) ) {		    // Now that we have a class object, instantiate one and		    // remember it:		    ORBInitializer initializer = null ; 		    try {			initializer = (ORBInitializer)AccessController.doPrivileged(			    new PrivilegedExceptionAction() {				public Object run() 				    throws InstantiationException, IllegalAccessException 				{				    return initClass.newInstance() ;				}			    } 			) ;		    } catch (PrivilegedActionException exc) {			// Unwrap the exception, as we don't care exc here			throw wrapper.orbInitializerFailure( exc.getException(), 			    initClass.getName() ) ;		    } catch (Exception exc) {			throw wrapper.orbInitializerFailure( exc, initClass.getName() ) ;		    }		    return initializer ;		} else {		    throw wrapper.orbInitializerType( initClass.getName() ) ;		}	    }	} ;	Operation result = OperationFactory.compose( mop, mkinst ) ;	return result ;    }    public static final class TestAcceptor1	implements Acceptor    {	public boolean equals( Object other )	{	    return other instanceof TestAcceptor1 ;	}	public boolean initialize() { return true; }	public boolean initialized() { return true; }	public String getConnectionCacheType() { return "FOO"; }	public void setConnectionCache(InboundConnectionCache connectionCache){}	public InboundConnectionCache getConnectionCache() { return null; }	public boolean shouldRegisterAcceptEvent() { return true; }	public void setUseSelectThreadForConnections(boolean x) { }	public boolean shouldUseSelectThreadForConnections() { return true; }	public void setUseWorkerThreadForConnections(boolean x) { }	public boolean shouldUseWorkerThreadForConnections() { return true; }	public void accept() { }	public void close() { }	public EventHandler getEventHandler() { return null; }	public MessageMediator createMessageMediator(            Broker xbroker, Connection xconnection) { return null; }	public MessageMediator finishCreatingMessageMediator(            Broker xbroker, Connection xconnection,	    MessageMediator messageMediator) { return null; }	public InputObject createInputObject(            Broker broker, MessageMediator messageMediator) { return null; }	public OutputObject createOutputObject(            Broker broker, MessageMediator messageMediator) { return null; }    }    public static final class TestAcceptor2	implements Acceptor    {	public boolean equals( Object other )	{	    return other instanceof TestAcceptor2 ;	}	public boolean initialize() { return true; }	public boolean initialized() { return true; }	public String getConnectionCacheType() { return "FOO"; }	public void setConnectionCache(InboundConnectionCache connectionCache){}	public InboundConnectionCache getConnectionCache() { return null; }	public boolean shouldRegisterAcceptEvent() { return true; }	public void setUseSelectThreadForConnections(boolean x) { }	public boolean shouldUseSelectThreadForConnections() { return true; }	public void setUseWorkerThreadForConnections(boolean x) { }	public boolean shouldUseWorkerThreadForConnections() { return true; }	public void accept() { }	public void close() { }	public EventHandler getEventHandler() { return null; }	public MessageMediator createMessageMediator(            Broker xbroker, Connection xconnection) { return null; }	public MessageMediator finishCreatingMessageMediator(            Broker xbroker, Connection xconnection,	    MessageMediator messageMediator) { return null; }	public InputObject createInputObject(            Broker broker, MessageMediator messageMediator) { return null; }	public OutputObject createOutputObject(            Broker broker, MessageMediator messageMediator) { return null; }    }    // REVISIT - this is a cut and paste modification of makeROIOperation.    private Operation makeAcceptorInstantiationOperation() {	Operation clsop = OperationFactory.classAction() ;	Operation indexOp = OperationFactory.suffixAction() ;	Operation op1 = OperationFactory.compose( indexOp, clsop ) ;	Operation mop = OperationFactory.maskErrorAction( op1 ) ;	Operation mkinst = new Operation() {	    public Object operate( Object value )	    {		final Class initClass = (Class)value ;		if (initClass == null)		    return null ;		// For security reasons avoid creating an instance 		// if this class is one that would fail the class cast 		// to ORBInitializer anyway.		if( Acceptor.class.isAssignableFrom( initClass ) ) {		    // Now that we have a class object, instantiate one and		    // remember it:		    Acceptor acceptor = null ; 		    try {			acceptor = (Acceptor)AccessController.doPrivileged(			    new PrivilegedExceptionAction() {				public Object run() 				    throws InstantiationException, IllegalAccessException 				{				    return initClass.newInstance() ;				}			    } 			) ;		    } catch (PrivilegedActionException exc) {			// Unwrap the exception, as we don't care exc here			throw wrapper.acceptorInstantiationFailure( exc.getException(), 			    initClass.getName() ) ;		    } catch (Exception exc) {			throw wrapper.acceptorInstantiationFailure( exc, initClass.getName() ) ;		    }		    return acceptor ;		} else {		    throw wrapper.acceptorInstantiationTypeFailure( initClass.getName() ) ;		}	    }	} ;	Operation result = OperationFactory.compose( mop, mkinst ) ;	return result ;    }    private Operation makeInitRefOperation() {	return new Operation() {	    public Object operate( Object value ) 	    {		// Object is String[] of length 2.		String[] values = (String[])value ;		if (values.length != 2)		    throw wrapper.orbInitialreferenceSyntax() ;		return values[0] + "=" + values[1] ;	    }	} ;    }}// End of file.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -