本文整理汇总了Java中com.sun.corba.se.spi.orb.ORB.init方法的典型用法代码示例。如果您正苦于以下问题:Java ORB.init方法的具体用法?Java ORB.init怎么用?Java ORB.init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.corba.se.spi.orb.ORB
的用法示例。
在下文中一共展示了ORB.init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createORB
import com.sun.corba.se.spi.orb.ORB; //导入方法依赖的package包/类
protected ORB createORB(String[] args)
{
Properties props = System.getProperties();
// For debugging.
//props.put( ORBConstants.DEBUG_PROPERTY, "naming" ) ;
//props.put( ORBConstants.DEBUG_PROPERTY, "transport,giop,naming" ) ;
props.put( ORBConstants.SERVER_ID_PROPERTY, "1000" ) ;
props.put( ORBConstants.PERSISTENT_SERVER_PORT_PROPERTY,
props.getProperty( ORBConstants.ORBD_PORT_PROPERTY,
Integer.toString(
ORBConstants.DEFAULT_ACTIVATION_PORT ) ) ) ;
// See Bug 4396928 for more information about why we are initializing
// the ORBClass to PIORB (now ORBImpl, but should check the bugid).
props.put("org.omg.CORBA.ORBClass",
"com.sun.corba.se.impl.orb.ORBImpl");
return (ORB) ORB.init(args, props);
}
示例2: main
import com.sun.corba.se.spi.orb.ORB; //导入方法依赖的package包/类
/**
* Typically the Repositoy is created within the ORBd VM but it can
* be independently started as well.
*/
public static void main(String args[]) {
boolean debug = false ;
for (int ctr=0; ctr<args.length; ctr++)
if (args[ctr].equals("-debug"))
debug = true ;
try {
// See Bug 4396928 for more information about why we are
// initializing the ORBClass to PIORB (now ORBImpl, but see the bug).
Properties props = new Properties();
props.put("org.omg.CORBA.ORBClass",
"com.sun.corba.se.impl.orb.ORBImpl");
ORB orb = (ORB) ORB.init(args, props);
// create the repository object
String db = System.getProperty( ORBConstants.DB_PROPERTY,
ORBConstants.DEFAULT_DB_NAME );
RepositoryImpl repository = new RepositoryImpl(orb, new File(db),
debug);
// wait for shutdown
orb.run();
} catch (Exception ex) {
ex.printStackTrace();
}
}