本文整理汇总了Java中org.omg.CORBA.ORB类的典型用法代码示例。如果您正苦于以下问题:Java ORB类的具体用法?Java ORB怎么用?Java ORB使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ORB类属于org.omg.CORBA包,在下文中一共展示了ORB类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getNamedMethod
import org.omg.CORBA.ORB; //导入依赖的package包/类
private Method getNamedMethod( Class serverClass, String methodName )
{
Class argTypes[] = new Class[] { org.omg.CORBA.ORB.class } ;
Method method = null ;
try {
method = serverClass.getDeclaredMethod( methodName, argTypes ) ;
} catch (Exception exc) {
return null ;
}
if (!isPublicStaticVoid( method ))
return null ;
return method ;
}
示例2: processCommand
import org.omg.CORBA.ORB; //导入依赖的package包/类
public boolean processCommand( String[] cmdArgs, ORB orb, PrintStream out )
{
if ((cmdArgs.length == 2) && cmdArgs[0].equals( "-applicationName" )) {
String str = (String)cmdArgs[1] ;
try {
Repository repository = RepositoryHelper.narrow(
orb.resolve_initial_references( ORBConstants.SERVER_REPOSITORY_NAME ));
try {
int result = repository.getServerID( str ) ;
out.println() ;
out.println(CorbaResourceUtil.getText("servertool.getserverid2", str, Integer.toString(result)));
out.println() ;
} catch (ServerNotRegistered e) {
out.println(CorbaResourceUtil.getText("servertool.nosuchserver"));
}
} catch (Exception ex) {
ex.printStackTrace() ;
}
return commandDone ;
} else
return parseError ;
}
示例3: main
import org.omg.CORBA.ORB; //导入依赖的package包/类
public static void main(String[] args) {
Properties systemProperties = System.getProperties();
systemProperties.setProperty("org.omg.CORBA.ORBSingletonClass",
"com.sun.corba.se.impl.orb.ORBSingleton");
System.setSecurityManager(new SecurityManager());
Properties props = new Properties();
props.put("org.omg.CORBA.ORBClass", "com.sun.corba.se.impl.orb.ORBImpl");
ORB orb = ORB.init(args, props);
Class<?> orbClass = orb.getClass();
if (orbClass.getName().equals("com.sun.corba.se.impl.orb.ORBImpl")) {
System.out.println("orbClass is com.sun.corba.se.impl.orb.ORBimpl as expected");
} else {
throw new RuntimeException("com.sun.corba.se.impl.orb.ORBimpl class expected for ORBImpl");
}
ORB singletonORB = ORB.init();
Class<?> singletoneOrbClass = singletonORB.getClass();
if (singletoneOrbClass.getName().equals("com.sun.corba.se.impl.orb.ORBSingleton")) {
System.out.println("singeletonOrbClass is com.sun.corba.se.impl.orb.ORBSingleton as expected");
} else {
throw new RuntimeException("com.sun.corba.se.impl.orb.ORBSingleton class expected for ORBSingleton");
}
}
示例4: TransientNamingContext
import org.omg.CORBA.ORB; //导入依赖的package包/类
/**
* Constructs a new TransientNamingContext object.
* @param orb an orb object.
* @param initial the initial naming context.
* @exception Exception a Java exception thrown of the base class cannot
* initialize.
*/
public TransientNamingContext(com.sun.corba.se.spi.orb.ORB orb,
org.omg.CORBA.Object initial,
POA nsPOA )
throws java.lang.Exception
{
super(orb, nsPOA );
wrapper = NamingSystemException.get( orb, CORBALogDomains.NAMING ) ;
this.localRoot = initial;
readLogger = orb.getLogger( CORBALogDomains.NAMING_READ);
updateLogger = orb.getLogger( CORBALogDomains.NAMING_UPDATE);
lifecycleLogger = orb.getLogger(
CORBALogDomains.NAMING_LIFECYCLE);
lifecycleLogger.fine( "Root TransientNamingContext LIFECYCLE.CREATED" );
}
示例5: readResolve
import org.omg.CORBA.ORB; //导入依赖的package包/类
public Object readResolve()
{
String repositoryId = ior.getRepositoryId() ;
String cname = RepositoryId.cache.getId( repositoryId ).getClassName() ;
Class cls = null ;
try {
cls = JDKBridge.loadClass( cname, null, null ) ;
} catch (ClassNotFoundException exc) {
// XXX log this
}
PresentationManager pm =
com.sun.corba.se.spi.orb.ORB.getPresentationManager() ;
PresentationManager.ClassData classData = pm.getClassData( cls ) ;
InvocationHandlerFactoryImpl ihfactory =
(InvocationHandlerFactoryImpl)classData.getInvocationHandlerFactory() ;
return ihfactory.getInvocationHandler( this ) ;
}
示例6: CodecFactoryImpl
import org.omg.CORBA.ORB; //导入依赖的package包/类
/**
* Creates a new CodecFactory implementation. Stores the ORB that
* created this factory, for later use by the Codec.
*/
public CodecFactoryImpl( ORB orb ) {
this.orb = orb;
wrapper = ORBUtilSystemException.get(
(com.sun.corba.se.spi.orb.ORB)orb,
CORBALogDomains.RPC_PROTOCOL ) ;
// Precreate a codec for version 1.0 through
// 1.(MAX_MINOR_VERSION_SUPPORTED). This can be
// done since Codecs are immutable in their current implementation.
// This is an optimization that eliminates the overhead of creating
// a new Codec each time create_codec is called.
for( int minor = 0; minor <= MAX_MINOR_VERSION_SUPPORTED; minor++ ) {
codecs[minor] = new CDREncapsCodec( orb, 1, minor );
}
}
示例7: getDelegate
import org.omg.CORBA.ORB; //导入依赖的package包/类
public Delegate getDelegate( ORB orb )
{
// write the IOR components to an org.omg.CORBA.portable.OutputStream
OutputStream ostr = orb.create_output_stream();
ostr.write_long(typeData.length);
ostr.write_octet_array(typeData, 0, typeData.length);
ostr.write_long(profileTags.length);
for (int i = 0; i < profileTags.length; i++) {
ostr.write_long(profileTags[i]);
ostr.write_long(profileData[i].length);
ostr.write_octet_array(profileData[i], 0, profileData[i].length);
}
InputStream istr = ostr.create_input_stream() ;
// read the IOR back from the stream
org.omg.CORBA.Object obj = (org.omg.CORBA.Object)istr.read_Object();
return StubAdapter.getDelegate( obj ) ;
}
示例8: getPrimitiveTypeCodeForClass
import org.omg.CORBA.ORB; //导入依赖的package包/类
public static TypeCode getPrimitiveTypeCodeForClass (ORB orb,
Class c,
ValueHandler vh) {
if (c == Integer.TYPE) {
return orb.get_primitive_tc (TCKind.tk_long);
} else if (c == Byte.TYPE) {
return orb.get_primitive_tc (TCKind.tk_octet);
} else if (c == Long.TYPE) {
return orb.get_primitive_tc (TCKind.tk_longlong);
} else if (c == Float.TYPE) {
return orb.get_primitive_tc (TCKind.tk_float);
} else if (c == Double.TYPE) {
return orb.get_primitive_tc (TCKind.tk_double);
} else if (c == Short.TYPE) {
return orb.get_primitive_tc (TCKind.tk_short);
} else if (c == Character.TYPE) {
return orb.get_primitive_tc (((ValueHandlerImpl)vh).getJavaCharTCKind());
} else if (c == Boolean.TYPE) {
return orb.get_primitive_tc (TCKind.tk_boolean);
} else {
// _REVISIT_ Not sure if this is right.
return orb.get_primitive_tc (TCKind.tk_any);
}
}
示例9: ServerCallback
import org.omg.CORBA.ORB; //导入依赖的package包/类
ServerCallback(ORB orb, Method installMethod, Method uninstallMethod,
Method shutdownMethod )
{
this.orb = orb;
this.installMethod = installMethod ;
this.uninstallMethod = uninstallMethod ;
this.shutdownMethod = shutdownMethod ;
orb.connect( this ) ;
methodArgs = new Object[] { orb } ;
}
示例10: createTypeCodeForClassInternal
import org.omg.CORBA.ORB; //导入依赖的package包/类
private static TypeCode createTypeCodeForClassInternal (ORB orb,
java.lang.Class c,
ValueHandler vh,
IdentityKeyValueStack createdIDs)
{
// This wrapper method is the protection against infinite recursion.
TypeCode tc = null;
String id = (String)createdIDs.get(c);
if (id != null) {
return orb.create_recursive_tc(id);
} else {
id = vh.getRMIRepositoryID(c);
if (id == null) id = "";
// cache the rep id BEFORE creating a new typecode.
// so that recursive tc can look up the rep id.
createdIDs.push(c, id);
tc = createTypeCodeInternal(orb, c, vh, id, createdIDs);
createdIDs.pop();
return tc;
}
}
示例11: processCommand
import org.omg.CORBA.ORB; //导入依赖的package包/类
public boolean processCommand(String[] cmdArgs, ORB orb, PrintStream out)
{
try {
Repository repository = RepositoryHelper.narrow(
orb.resolve_initial_references( ORBConstants.SERVER_REPOSITORY_NAME ));
String[] applicationNames = repository.getApplicationNames();
out.println(CorbaResourceUtil.getText("servertool.listappnames2"));
out.println();
for (int i=0; i < applicationNames.length; i++)
out.println( "\t" + applicationNames[i] ) ;
} catch (Exception ex) {
ex.printStackTrace();
}
return commandDone;
}
示例12: _this_object
import org.omg.CORBA.ORB; //导入依赖的package包/类
/**
* Allows the servant to obtain the object reference for
* the target CORBA Object it is incarnating for that request.
* @param orb ORB with which the servant is associated.
* @return <code>_this_object</code> reference associated with the request.
*/
final public org.omg.CORBA.Object _this_object(ORB orb) {
try {
((org.omg.CORBA_2_3.ORB)orb).set_delegate(this);
}
catch(ClassCastException e) {
throw
new
org.omg.CORBA.BAD_PARAM
("POA Servant requires an instance of org.omg.CORBA_2_3.ORB");
}
return _this_object();
}
示例13: getORB
import org.omg.CORBA.ORB; //导入依赖的package包/类
public static ORB getORB( Object stub )
{
if (stub instanceof DynamicStub)
return ((DynamicStub)stub).getORB() ;
else if (stub instanceof ObjectImpl)
return (ORB)((ObjectImpl)stub)._orb() ;
else
throw wrapper.getOrbRequiresStub() ;
}
示例14: connect
import org.omg.CORBA.ORB; //导入依赖的package包/类
public static void connect( Object stub,
ORB orb ) throws java.rmi.RemoteException
{
if (stub instanceof DynamicStub)
((DynamicStub)stub).connect(
(com.sun.corba.se.spi.orb.ORB)orb ) ;
else if (stub instanceof javax.rmi.CORBA.Stub)
((javax.rmi.CORBA.Stub)stub).connect( orb ) ;
else if (stub instanceof ObjectImpl)
orb.connect( (org.omg.CORBA.Object)stub ) ;
else
throw wrapper.connectRequiresStub() ;
}
示例15: getServerIdForAlias
import org.omg.CORBA.ORB; //导入依赖的package包/类
static int getServerIdForAlias( ORB orb, String applicationName ) throws ServerNotRegistered
{
try {
Repository rep = RepositoryHelper.narrow(
orb.resolve_initial_references( ORBConstants.SERVER_REPOSITORY_NAME ) ) ;
int serverid = rep.getServerID(applicationName);
return rep.getServerID( applicationName ) ;
} catch (Exception ex) {
throw (new ServerNotRegistered());
}
}