下面列出了怎么用org.omg.CORBA.portable.IDLEntity的API类实例代码及写法,或者点击链接到github查看源代码。
/**
* Createa a repository ID for the type if it is either a java type
* or an IDL type.
* @param type The type to create rep. id for
* @return The rep. id.
**/
public static String createForAnyType(Class type) {
try{
if (type.isArray())
return createSequenceRepID(type);
else if (IDLEntity.class.isAssignableFrom(type))
{
try{
return getIdFromHelper(type);
}
catch(Throwable t) {
return createForIDLType(type, 1, 0);
}
}
else return createForJavaType(type);
}
catch(com.sun.corba.se.impl.io.TypeMismatchException e){
return null;
}
}
/**
* Createa a repository ID for the type if it is either a java type
* or an IDL type.
* @param type The type to create rep. id for
* @return The rep. id.
**/
public static String createForAnyType(Class type) {
try{
if (type.isArray())
return createSequenceRepID(type);
else if (IDLEntity.class.isAssignableFrom(type))
{
try{
return getIdFromHelper(type);
}
catch(Throwable t) {
return createForIDLType(type, 1, 0);
}
}
else return createForJavaType(type);
}
catch(com.sun.corba.se.impl.io.TypeMismatchException e){
return null;
}
}
/**
* Createa a repository ID for the type if it is either a java type
* or an IDL type.
* @param type The type to create rep. id for
* @return The rep. id.
**/
public static String createForAnyType(Class type) {
try{
if (type.isArray())
return createSequenceRepID(type);
else if (IDLEntity.class.isAssignableFrom(type))
{
try{
return getIdFromHelper(type);
}
catch(Throwable t) {
return createForIDLType(type, 1, 0);
}
}
else return createForJavaType(type);
}
catch(com.sun.corba.se.impl.io.TypeMismatchException e){
return null;
}
}
/**
* Createa a repository ID for the type if it is either a java type
* or an IDL type.
* @param type The type to create rep. id for
* @return The rep. id.
**/
public static String createForAnyType(Class type) {
try{
if (type.isArray())
return createSequenceRepID(type);
else if (IDLEntity.class.isAssignableFrom(type))
{
try{
return getIdFromHelper(type);
}
catch(Throwable t) {
return createForIDLType(type, 1, 0);
}
}
else return createForJavaType(type);
}
catch(com.sun.corba.se.impl.io.TypeMismatchException e){
return null;
}
}
/**
* Createa a repository ID for the type if it is either a java type
* or an IDL type.
* @param type The type to create rep. id for
* @return The rep. id.
**/
public static String createForAnyType(Class type) {
try{
if (type.isArray())
return createSequenceRepID(type);
else if (IDLEntity.class.isAssignableFrom(type))
{
try{
return getIdFromHelper(type);
}
catch(Throwable t) {
return createForIDLType(type, 1, 0);
}
}
else return createForJavaType(type);
}
catch(com.sun.corba.se.impl.io.TypeMismatchException e){
return null;
}
}
/**
* Createa a repository ID for the type if it is either a java type
* or an IDL type.
* @param type The type to create rep. id for
* @return The rep. id.
**/
public static String createForAnyType(Class type) {
try{
if (type.isArray())
return createSequenceRepID(type);
else if (IDLEntity.class.isAssignableFrom(type))
{
try{
return getIdFromHelper(type);
}
catch(Throwable t) {
return createForIDLType(type, 1, 0);
}
}
else return createForJavaType(type);
}
catch(com.sun.corba.se.impl.io.TypeMismatchException e){
return null;
}
}
/**
* Createa a repository ID for the type if it is either a java type
* or an IDL type.
* @param type The type to create rep. id for
* @return The rep. id.
**/
public static String createForAnyType(Class type) {
try{
if (type.isArray())
return createSequenceRepID(type);
else if (IDLEntity.class.isAssignableFrom(type))
{
try{
return getIdFromHelper(type);
}
catch(Throwable t) {
return createForIDLType(type, 1, 0);
}
}
else return createForJavaType(type);
}
catch(com.sun.corba.se.impl.io.TypeMismatchException e){
return null;
}
}
/**
* Createa a repository ID for the type if it is either a java type
* or an IDL type.
* @param type The type to create rep. id for
* @return The rep. id.
**/
public static String createForAnyType(Class type) {
try{
if (type.isArray())
return createSequenceRepID(type);
else if (IDLEntity.class.isAssignableFrom(type))
{
try{
return getIdFromHelper(type);
}
catch(Throwable t) {
return createForIDLType(type, 1, 0);
}
}
else return createForJavaType(type);
}
catch(com.sun.corba.se.impl.io.TypeMismatchException e){
return null;
}
}
/**
* Createa a repository ID for the type if it is either a java type
* or an IDL type.
* @param type The type to create rep. id for
* @return The rep. id.
**/
public static String createForAnyType(Class type) {
try{
if (type.isArray())
return createSequenceRepID(type);
else if (IDLEntity.class.isAssignableFrom(type))
{
try{
return getIdFromHelper(type);
}
catch(Throwable t) {
return createForIDLType(type, 1, 0);
}
}
else return createForJavaType(type);
}
catch(com.sun.corba.se.impl.io.TypeMismatchException e){
return null;
}
}
/**
* Createa a repository ID for the type if it is either a java type
* or an IDL type.
* @param type The type to create rep. id for
* @return The rep. id.
**/
public static String createForAnyType(Class type) {
try{
if (type.isArray())
return createSequenceRepID(type);
else if (IDLEntity.class.isAssignableFrom(type))
{
try{
return getIdFromHelper(type);
}
catch(Throwable t) {
return createForIDLType(type, 1, 0);
}
}
else return createForJavaType(type);
}
catch(com.sun.corba.se.impl.io.TypeMismatchException e){
return null;
}
}
public PresentationManager.StubFactory createStubFactory(
String className, boolean isIDLStub, String remoteCodeBase,
Class expectedClass, ClassLoader classLoader)
{
Class cls = null ;
try {
cls = Util.loadClass( className, remoteCodeBase, classLoader ) ;
} catch (ClassNotFoundException exc) {
throw wrapper.classNotFound3(
CompletionStatus.COMPLETED_MAYBE, exc, className ) ;
}
PresentationManager pm = ORB.getPresentationManager() ;
if (IDLEntity.class.isAssignableFrom( cls ) &&
!Remote.class.isAssignableFrom( cls )) {
// IDL stubs must always use static factories.
PresentationManager.StubFactoryFactory sff =
pm.getStubFactoryFactory( false ) ;
PresentationManager.StubFactory sf =
sff.createStubFactory( className, true, remoteCodeBase,
expectedClass, classLoader ) ;
return sf ;
} else {
PresentationManager.ClassData classData = pm.getClassData( cls ) ;
return makeDynamicStubFactory( pm, classData, classLoader ) ;
}
}
private static boolean isAbstractInterface( Class cls )
{
// Either cls is an interface that extends IDLEntity, or else
// cls does not extend java.rmi.Remote and all of its methods
// throw RemoteException.
if (IDLEntity.class.isAssignableFrom( cls ))
return cls.isInterface() ;
else
return cls.isInterface() && allMethodsThrowRemoteException( cls ) ;
}
public static boolean isAbstractBase(Class clazz) {
return (clazz.isInterface() &&
IDLEntity.class.isAssignableFrom(clazz) &&
(!ValueBase.class.isAssignableFrom(clazz)) &&
(!org.omg.CORBA.Object.class.isAssignableFrom(clazz)));
}
public PresentationManager.StubFactory createStubFactory(
String className, boolean isIDLStub, String remoteCodeBase,
Class expectedClass, ClassLoader classLoader)
{
Class cls = null ;
try {
cls = Util.loadClass( className, remoteCodeBase, classLoader ) ;
} catch (ClassNotFoundException exc) {
throw wrapper.classNotFound3(
CompletionStatus.COMPLETED_MAYBE, exc, className ) ;
}
PresentationManager pm = ORB.getPresentationManager() ;
if (IDLEntity.class.isAssignableFrom( cls ) &&
!Remote.class.isAssignableFrom( cls )) {
// IDL stubs must always use static factories.
PresentationManager.StubFactoryFactory sff =
pm.getStubFactoryFactory( false ) ;
PresentationManager.StubFactory sf =
sff.createStubFactory( className, true, remoteCodeBase,
expectedClass, classLoader ) ;
return sf ;
} else {
PresentationManager.ClassData classData = pm.getClassData( cls ) ;
return makeDynamicStubFactory( pm, classData, classLoader ) ;
}
}
private static boolean isAbstractInterface( Class cls )
{
// Either cls is an interface that extends IDLEntity, or else
// cls does not extend java.rmi.Remote and all of its methods
// throw RemoteException.
if (IDLEntity.class.isAssignableFrom( cls ))
return cls.isInterface() ;
else
return cls.isInterface() && allMethodsThrowRemoteException( cls ) ;
}
public static boolean isAbstractBase(Class clazz) {
return (clazz.isInterface() &&
IDLEntity.class.isAssignableFrom(clazz) &&
(!ValueBase.class.isAssignableFrom(clazz)) &&
(!org.omg.CORBA.Object.class.isAssignableFrom(clazz)));
}
public PresentationManager.StubFactory createStubFactory(
String className, boolean isIDLStub, String remoteCodeBase,
Class expectedClass, ClassLoader classLoader)
{
Class cls = null ;
try {
cls = Util.loadClass( className, remoteCodeBase, classLoader ) ;
} catch (ClassNotFoundException exc) {
throw wrapper.classNotFound3(
CompletionStatus.COMPLETED_MAYBE, exc, className ) ;
}
PresentationManager pm = ORB.getPresentationManager() ;
if (IDLEntity.class.isAssignableFrom( cls ) &&
!Remote.class.isAssignableFrom( cls )) {
// IDL stubs must always use static factories.
PresentationManager.StubFactoryFactory sff =
pm.getStubFactoryFactory( false ) ;
PresentationManager.StubFactory sf =
sff.createStubFactory( className, true, remoteCodeBase,
expectedClass, classLoader ) ;
return sf ;
} else {
PresentationManager.ClassData classData = pm.getClassData( cls ) ;
return makeDynamicStubFactory( pm, classData, classLoader ) ;
}
}
private static boolean isAbstractInterface( Class cls )
{
// Either cls is an interface that extends IDLEntity, or else
// cls does not extend java.rmi.Remote and all of its methods
// throw RemoteException.
if (IDLEntity.class.isAssignableFrom( cls ))
return cls.isInterface() ;
else
return cls.isInterface() && allMethodsThrowRemoteException( cls ) ;
}
public static boolean isAbstractBase(Class clazz) {
return (clazz.isInterface() &&
IDLEntity.class.isAssignableFrom(clazz) &&
(!ValueBase.class.isAssignableFrom(clazz)) &&
(!org.omg.CORBA.Object.class.isAssignableFrom(clazz)));
}
public PresentationManager.StubFactory createStubFactory(
String className, boolean isIDLStub, String remoteCodeBase,
Class expectedClass, ClassLoader classLoader)
{
Class cls = null ;
try {
cls = Util.loadClass( className, remoteCodeBase, classLoader ) ;
} catch (ClassNotFoundException exc) {
throw wrapper.classNotFound3(
CompletionStatus.COMPLETED_MAYBE, exc, className ) ;
}
PresentationManager pm = ORB.getPresentationManager() ;
if (IDLEntity.class.isAssignableFrom( cls ) &&
!Remote.class.isAssignableFrom( cls )) {
// IDL stubs must always use static factories.
PresentationManager.StubFactoryFactory sff =
pm.getStubFactoryFactory( false ) ;
PresentationManager.StubFactory sf =
sff.createStubFactory( className, true, remoteCodeBase,
expectedClass, classLoader ) ;
return sf ;
} else {
PresentationManager.ClassData classData = pm.getClassData( cls ) ;
return makeDynamicStubFactory( pm, classData, classLoader ) ;
}
}
private static boolean isAbstractInterface( Class cls )
{
// Either cls is an interface that extends IDLEntity, or else
// cls does not extend java.rmi.Remote and all of its methods
// throw RemoteException.
if (IDLEntity.class.isAssignableFrom( cls ))
return cls.isInterface() ;
else
return cls.isInterface() && allMethodsThrowRemoteException( cls ) ;
}
public static boolean isAbstractBase(Class clazz) {
return (clazz.isInterface() &&
IDLEntity.class.isAssignableFrom(clazz) &&
(!ValueBase.class.isAssignableFrom(clazz)) &&
(!org.omg.CORBA.Object.class.isAssignableFrom(clazz)));
}
public PresentationManager.StubFactory createStubFactory(
String className, boolean isIDLStub, String remoteCodeBase,
Class expectedClass, ClassLoader classLoader)
{
Class cls = null ;
try {
cls = Util.loadClass( className, remoteCodeBase, classLoader ) ;
} catch (ClassNotFoundException exc) {
throw wrapper.classNotFound3(
CompletionStatus.COMPLETED_MAYBE, exc, className ) ;
}
PresentationManager pm = ORB.getPresentationManager() ;
if (IDLEntity.class.isAssignableFrom( cls ) &&
!Remote.class.isAssignableFrom( cls )) {
// IDL stubs must always use static factories.
PresentationManager.StubFactoryFactory sff =
pm.getStubFactoryFactory( false ) ;
PresentationManager.StubFactory sf =
sff.createStubFactory( className, true, remoteCodeBase,
expectedClass, classLoader ) ;
return sf ;
} else {
PresentationManager.ClassData classData = pm.getClassData( cls ) ;
return makeDynamicStubFactory( pm, classData, classLoader ) ;
}
}
private static boolean isAbstractInterface( Class cls )
{
// Either cls is an interface that extends IDLEntity, or else
// cls does not extend java.rmi.Remote and all of its methods
// throw RemoteException.
if (IDLEntity.class.isAssignableFrom( cls ))
return cls.isInterface() ;
else
return cls.isInterface() && allMethodsThrowRemoteException( cls ) ;
}
public static boolean isAbstractBase(Class clazz) {
return (clazz.isInterface() &&
IDLEntity.class.isAssignableFrom(clazz) &&
(!ValueBase.class.isAssignableFrom(clazz)) &&
(!org.omg.CORBA.Object.class.isAssignableFrom(clazz)));
}
public PresentationManager.StubFactory createStubFactory(
String className, boolean isIDLStub, String remoteCodeBase,
Class expectedClass, ClassLoader classLoader)
{
Class cls = null ;
try {
cls = Util.loadClass( className, remoteCodeBase, classLoader ) ;
} catch (ClassNotFoundException exc) {
throw wrapper.classNotFound3(
CompletionStatus.COMPLETED_MAYBE, exc, className ) ;
}
PresentationManager pm = ORB.getPresentationManager() ;
if (IDLEntity.class.isAssignableFrom( cls ) &&
!Remote.class.isAssignableFrom( cls )) {
// IDL stubs must always use static factories.
PresentationManager.StubFactoryFactory sff =
pm.getStubFactoryFactory( false ) ;
PresentationManager.StubFactory sf =
sff.createStubFactory( className, true, remoteCodeBase,
expectedClass, classLoader ) ;
return sf ;
} else {
PresentationManager.ClassData classData = pm.getClassData( cls ) ;
return makeDynamicStubFactory( pm, classData, classLoader ) ;
}
}
private static boolean isAbstractInterface( Class cls )
{
// Either cls is an interface that extends IDLEntity, or else
// cls does not extend java.rmi.Remote and all of its methods
// throw RemoteException.
if (IDLEntity.class.isAssignableFrom( cls ))
return cls.isInterface() ;
else
return cls.isInterface() && allMethodsThrowRemoteException( cls ) ;
}
public static boolean isAbstractBase(Class clazz) {
return (clazz.isInterface() &&
IDLEntity.class.isAssignableFrom(clazz) &&
(!ValueBase.class.isAssignableFrom(clazz)) &&
(!org.omg.CORBA.Object.class.isAssignableFrom(clazz)));
}
public PresentationManager.StubFactory createStubFactory(
String className, boolean isIDLStub, String remoteCodeBase,
Class expectedClass, ClassLoader classLoader)
{
Class cls = null ;
try {
cls = Util.loadClass( className, remoteCodeBase, classLoader ) ;
} catch (ClassNotFoundException exc) {
throw wrapper.classNotFound3(
CompletionStatus.COMPLETED_MAYBE, exc, className ) ;
}
PresentationManager pm = ORB.getPresentationManager() ;
if (IDLEntity.class.isAssignableFrom( cls ) &&
!Remote.class.isAssignableFrom( cls )) {
// IDL stubs must always use static factories.
PresentationManager.StubFactoryFactory sff =
pm.getStubFactoryFactory( false ) ;
PresentationManager.StubFactory sf =
sff.createStubFactory( className, true, remoteCodeBase,
expectedClass, classLoader ) ;
return sf ;
} else {
PresentationManager.ClassData classData = pm.getClassData( cls ) ;
return makeDynamicStubFactory( pm, classData, classLoader ) ;
}
}
private static boolean isAbstractInterface( Class cls )
{
// Either cls is an interface that extends IDLEntity, or else
// cls does not extend java.rmi.Remote and all of its methods
// throw RemoteException.
if (IDLEntity.class.isAssignableFrom( cls ))
return cls.isInterface() ;
else
return cls.isInterface() && allMethodsThrowRemoteException( cls ) ;
}