本文整理汇总了Java中com.sun.corba.se.spi.orb.ORB.ORBInitDebug方法的典型用法代码示例。如果您正苦于以下问题:Java ORB.ORBInitDebug方法的具体用法?Java ORB.ORBInitDebug怎么用?Java ORB.ORBInitDebug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.corba.se.spi.orb.ORB
的用法示例。
在下文中一共展示了ORB.ORBInitDebug方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findServiceContextData
import com.sun.corba.se.spi.orb.ORB; //导入方法依赖的package包/类
public ServiceContextData findServiceContextData( int scId )
{
if (ORB.ORBInitDebug)
dprint( "Searching registry for service context id " + scId ) ;
Enumeration enumeration = scCollection.elements() ;
while (enumeration.hasMoreElements()) {
ServiceContextData scd =
(ServiceContextData)(enumeration.nextElement()) ;
if (scd.getId() == scId) {
if (ORB.ORBInitDebug)
dprint( "Service context data found: " + scd ) ;
return scd ;
}
}
if (ORB.ORBInitDebug)
dprint( "Service context data not found" ) ;
return null ;
}
示例2: register
import com.sun.corba.se.spi.orb.ORB; //导入方法依赖的package包/类
/** Register the ServiceContext class so that it will be recognized
* by the read method.
* Class cls must have the following properties:
* <ul>
* <li>It must derive from com.sun.corba.se.spi.servicecontext.ServiceContext.</li>
* <li>It must have a public static final int SERVICE_CONTEXT_ID
* member.</li>
* <li>It must implement a constructor that takes a
* org.omg.CORBA_2_3.portable.InputStream argument.</li>
* </ul>
*/
public void register( Class cls )
{
if (ORB.ORBInitDebug)
dprint( "Registering service context class " + cls ) ;
ServiceContextData scd = new ServiceContextData( cls ) ;
if (findServiceContextData(scd.getId()) == null)
scCollection.addElement( scd ) ;
else
throw new BAD_PARAM( "Tried to register duplicate service context" ) ;
}
示例3: ServiceContextData
import com.sun.corba.se.spi.orb.ORB; //导入方法依赖的package包/类
public ServiceContextData( Class cls )
{
if (ORB.ORBInitDebug)
dprint( "ServiceContextData constructor called for class " + cls ) ;
scClass = cls ;
try {
if (ORB.ORBInitDebug)
dprint( "Finding constructor for " + cls ) ;
// Find the appropriate constructor in cls
Class[] args = new Class[2] ;
args[0] = InputStream.class ;
args[1] = GIOPVersion.class;
try {
scConstructor = cls.getConstructor( args ) ;
} catch (NoSuchMethodException nsme) {
throwBadParam( "Class does not have an InputStream constructor", nsme ) ;
}
if (ORB.ORBInitDebug)
dprint( "Finding SERVICE_CONTEXT_ID field in " + cls ) ;
// get the ID from the public static final int SERVICE_CONTEXT_ID
Field fld = null ;
try {
fld = cls.getField( "SERVICE_CONTEXT_ID" ) ;
} catch (NoSuchFieldException nsfe) {
throwBadParam( "Class does not have a SERVICE_CONTEXT_ID member", nsfe ) ;
} catch (SecurityException se) {
throwBadParam( "Could not access SERVICE_CONTEXT_ID member", se ) ;
}
if (ORB.ORBInitDebug)
dprint( "Checking modifiers of SERVICE_CONTEXT_ID field in " + cls ) ;
int mod = fld.getModifiers() ;
if (!Modifier.isPublic(mod) || !Modifier.isStatic(mod) ||
!Modifier.isFinal(mod) )
throwBadParam( "SERVICE_CONTEXT_ID field is not public static final", null ) ;
if (ORB.ORBInitDebug)
dprint( "Getting value of SERVICE_CONTEXT_ID in " + cls ) ;
try {
scId = fld.getInt( null ) ;
} catch (IllegalArgumentException iae) {
throwBadParam( "SERVICE_CONTEXT_ID not convertible to int", iae ) ;
} catch (IllegalAccessException iae2) {
throwBadParam( "Could not access value of SERVICE_CONTEXT_ID", iae2 ) ;
}
} catch (BAD_PARAM nssc) {
if (ORB.ORBInitDebug)
dprint( "Exception in ServiceContextData constructor: " + nssc ) ;
throw nssc ;
} catch (Throwable thr) {
if (ORB.ORBInitDebug)
dprint( "Unexpected Exception in ServiceContextData constructor: " +
thr ) ;
}
if (ORB.ORBInitDebug)
dprint( "ServiceContextData constructor completed" ) ;
}