本文整理汇总了Java中com.sun.corba.se.impl.orbutil.ORBConstants类的典型用法代码示例。如果您正苦于以下问题:Java ORBConstants类的具体用法?Java ORBConstants怎么用?Java ORBConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ORBConstants类属于com.sun.corba.se.impl.orbutil包,在下文中一共展示了ORBConstants类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getStreamFormatVersionForReply
import com.sun.corba.se.impl.orbutil.ORBConstants; //导入依赖的package包/类
/**
* If the RMI-IIOP maximum stream format version service context
* is present, it indicates the maximum stream format version we
* could use for the reply. If it isn't present, the default is
* 2 for GIOP 1.3 or greater, 1 for lower.
*
* This is only sent on requests. Clients can find out the
* server's maximum by looking for a tagged component in the IOR.
*/
public byte getStreamFormatVersionForReply() {
// NOTE: The request service contexts may indicate the max.
ServiceContexts svc = getRequestServiceContexts();
MaxStreamFormatVersionServiceContext msfvsc
= (MaxStreamFormatVersionServiceContext)svc.get(
MaxStreamFormatVersionServiceContext.SERVICE_CONTEXT_ID);
if (msfvsc != null) {
byte localMaxVersion = ORBUtility.getMaxStreamFormatVersion();
byte remoteMaxVersion = msfvsc.getMaximumStreamFormatVersion();
return (byte)Math.min(localMaxVersion, remoteMaxVersion);
} else {
// Defaults to 1 for GIOP 1.2 or less, 2 for
// GIOP 1.3 or higher.
if (getGIOPVersion().lessThan(GIOPVersion.V1_3))
return ORBConstants.STREAM_FORMAT_VERSION_1;
else
return ORBConstants.STREAM_FORMAT_VERSION_2;
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:33,代码来源:CorbaMessageMediatorImpl.java
示例2: createAppropriateOutputObject
import com.sun.corba.se.impl.orbutil.ORBConstants; //导入依赖的package包/类
private CDROutputObject createAppropriateOutputObject(
CorbaMessageMediator messageMediator,
Message msg, LocateReplyMessage reply)
{
CDROutputObject outputObject;
if (msg.getGIOPVersion().lessThan(GIOPVersion.V1_2)) {
// locate msgs 1.0 & 1.1 :=> grow,
outputObject = sun.corba.OutputStreamFactory.newCDROutputObject(
(ORB) messageMediator.getBroker(),
this,
GIOPVersion.V1_0,
(CorbaConnection) messageMediator.getConnection(),
reply,
ORBConstants.STREAM_FORMAT_VERSION_1);
} else {
// 1.2 :=> stream
outputObject = sun.corba.OutputStreamFactory.newCDROutputObject(
(ORB) messageMediator.getBroker(),
messageMediator,
reply,
ORBConstants.STREAM_FORMAT_VERSION_1);
}
return outputObject;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:CorbaMessageMediatorImpl.java
示例3: createORB
import com.sun.corba.se.impl.orbutil.ORBConstants; //导入依赖的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);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:ORBD.java
示例4: processCommand
import com.sun.corba.se.impl.orbutil.ORBConstants; //导入依赖的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;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:ServerTool.java
示例5: processCommand
import com.sun.corba.se.impl.orbutil.ORBConstants; //导入依赖的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 ;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:ServerTool.java
示例6: run
import com.sun.corba.se.impl.orbutil.ORBConstants; //导入依赖的package包/类
protected void run()
{
try {
// create the persistent name service
NameService ns = new NameService(orb, dbDir);
// add root naming context to initial naming
NamingContext rootContext = ns.initialNamingContext();
InitialNameService ins = InitialNameServiceHelper.narrow(
orb.resolve_initial_references(
ORBConstants.INITIAL_NAME_SERVICE_NAME ));
ins.bind( "NameService", rootContext, true);
System.out.println(CorbaResourceUtil.getText("pnameserv.success"));
// wait for invocations
orb.run();
} catch (Exception ex) {
ex.printStackTrace(System.err);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:NameServer.java
示例7: TOAImpl
import com.sun.corba.se.impl.orbutil.ORBConstants; //导入依赖的package包/类
public TOAImpl( ORB orb, TransientObjectManager tom, String codebase )
{
super( orb ) ;
servants = tom ;
// Make the object key template
int serverid = ((ORB)getORB()).getTransientServerId();
int scid = ORBConstants.TOA_SCID ;
ObjectKeyTemplate oktemp = new JIDLObjectKeyTemplate( orb, scid, serverid ) ;
// REVISIT - POA specific
Policies policies = Policies.defaultPolicies;
// REVISIT - absorb codebase into a policy
initializeTemplate( oktemp, true,
policies,
codebase,
null, // manager id
oktemp.getObjectAdapterId()
) ;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:TOAImpl.java
示例8: makeFSOperation
import com.sun.corba.se.impl.orbutil.ORBConstants; //导入依赖的package包/类
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 ;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:ParserTable.java
示例9: alignAndReserve
import com.sun.corba.se.impl.orbutil.ORBConstants; //导入依赖的package包/类
protected void alignAndReserve(int align, int n) {
// headerPadding bit is set by the write operation of RequestMessage_1_2
// or ReplyMessage_1_2 classes. When set, the very first body write
// operation (from the stub code) would trigger an alignAndReserve
// method call, that would in turn add the appropriate header padding,
// such that the body is aligned on a 8-octet boundary. The padding
// is required for GIOP versions 1.2 and above, only if body is present.
if (headerPadding == true) {
headerPadding = false;
alignOnBoundary(ORBConstants.GIOP_12_MSG_BODY_ALIGNMENT);
}
// In GIOP 1.2, we always end fragments at our
// fragment size, which is an "evenly divisible
// 8 byte boundary" (aka divisible by 16). A fragment can
// end with appropriate alignment padding, but no padding
// is needed with respect to the next GIOP fragment
// header since it ends on an 8 byte boundary.
bbwi.position(bbwi.position() + computeAlignment(align));
if (bbwi.position() + n > bbwi.buflen)
grow(align, n);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:CDROutputStream_1_2.java
示例10: getIORFromString
import com.sun.corba.se.impl.orbutil.ORBConstants; //导入依赖的package包/类
/** This static method takes a Stringified IOR and converts it into IOR object.
* It is the caller's responsibility to only pass strings that start with "IOR:".
*/
private org.omg.CORBA.Object getIORFromString( String str )
{
// Length must be even for str to be valid
if ( (str.length() & 1) == 1 )
throw wrapper.badStringifiedIorLen() ;
byte[] buf = new byte[(str.length() - ORBConstants.STRINGIFY_PREFIX.length()) / NIBBLES_PER_BYTE];
for (int i=ORBConstants.STRINGIFY_PREFIX.length(), j=0; i < str.length(); i +=NIBBLES_PER_BYTE, j++) {
buf[j] = (byte)((ORBUtility.hexOf(str.charAt(i)) << UN_SHIFT) & 0xF0);
buf[j] |= (byte)(ORBUtility.hexOf(str.charAt(i+1)) & 0x0F);
}
EncapsInputStream s = EncapsInputStreamFactory.newEncapsInputStream(orb, buf, buf.length,
orb.getORBData().getGIOPVersion());
s.consumeEndian();
return s.read_Object() ;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:INSURLOperationImpl.java
示例11: checkPropertyDefaults
import com.sun.corba.se.impl.orbutil.ORBConstants; //导入依赖的package包/类
protected void checkPropertyDefaults()
{
String host =
resultProps.getProperty( ORBConstants.INITIAL_HOST_PROPERTY ) ;
if ((host == null) || (host.equals("")))
setProperty( ORBConstants.INITIAL_HOST_PROPERTY,
configurationHostName );
String serverHost =
resultProps.getProperty( ORBConstants.SERVER_HOST_PROPERTY ) ;
if (serverHost == null ||
serverHost.equals("") ||
serverHost.equals("0.0.0.0") ||
serverHost.equals("::") ||
serverHost.toLowerCase().equals("::ffff:0.0.0.0"))
{
setProperty(ORBConstants.SERVER_HOST_PROPERTY,
localHostName);
setProperty(ORBConstants.LISTEN_ON_ALL_INTERFACES,
ORBConstants.LISTEN_ON_ALL_INTERFACES);
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:25,代码来源:DataCollectorBase.java
示例12: isLocalServerId
import com.sun.corba.se.impl.orbutil.ORBConstants; //导入依赖的package包/类
public boolean isLocalServerId( int subcontractId, int serverId )
{
synchronized (this) {
checkShutdownState();
}
if ((subcontractId < ORBConstants.FIRST_POA_SCID) ||
(subcontractId > ORBConstants.MAX_POA_SCID))
return serverId == getTransientServerId( ) ;
// XXX isTransient info should be stored in subcontract registry
if (ORBConstants.isTransient( subcontractId ))
return (serverId == getTransientServerId()) ;
else if (configData.getPersistentServerIdInitialized())
return (serverId == configData.getPersistentServerId()) ;
else
return false ;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:ORBImpl.java
示例13: getStreamFormatVersionForThisRequest
import com.sun.corba.se.impl.orbutil.ORBConstants; //导入依赖的package包/类
private byte getStreamFormatVersionForThisRequest(IOR ior,
GIOPVersion giopVersion)
{
byte localMaxVersion
= ORBUtility.getMaxStreamFormatVersion();
IOR effectiveTargetIOR =
((CorbaContactInfo)this.contactInfo).getEffectiveTargetIOR();
IIOPProfileTemplate temp =
(IIOPProfileTemplate)effectiveTargetIOR.getProfile().getTaggedProfileTemplate();
Iterator iter = temp.iteratorById(TAG_RMI_CUSTOM_MAX_STREAM_FORMAT.value);
if (!iter.hasNext()) {
// Didn't have the max stream format version tagged
// component.
if (giopVersion.lessThan(GIOPVersion.V1_3))
return ORBConstants.STREAM_FORMAT_VERSION_1;
else
return ORBConstants.STREAM_FORMAT_VERSION_2;
}
byte remoteMaxVersion
= ((MaxStreamFormatVersionComponent)iter.next()).getMaxStreamFormatVersion();
return (byte)Math.min(localMaxVersion, remoteMaxVersion);
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:27,代码来源:CorbaMessageMediatorImpl.java
示例14: start
import com.sun.corba.se.impl.orbutil.ORBConstants; //导入依赖的package包/类
static void start( HashMap serverTable ) {
int sleepTime = ORBConstants.DEFAULT_SERVER_POLLING_TIME;
String pollingTime = System.getProperties().getProperty(
ORBConstants.SERVER_POLLING_TIME );
if ( pollingTime != null ) {
try {
sleepTime = Integer.parseInt( pollingTime );
} catch (Exception e ) {
// Too late to complain, Just use the default
// sleepTime
}
}
instance = new ProcessMonitorThread( serverTable,
sleepTime );
instance.setDaemon( true );
instance.start();
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:ProcessMonitorThread.java
示例15: makeRequestPartitioningComponentFactory
import com.sun.corba.se.impl.orbutil.ORBConstants; //导入依赖的package包/类
public static IdentifiableFactory makeRequestPartitioningComponentFactory()
{
return new EncapsulationFactoryBase(ORBConstants.TAG_REQUEST_PARTITIONING_ID) {
public Identifiable readContents(InputStream in)
{
int threadPoolToUse = in.read_ulong();
Identifiable comp =
new RequestPartitioningComponentImpl(threadPoolToUse);
return comp;
}
};
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:IIOPFactories.java
示例16: sendHelper
import com.sun.corba.se.impl.orbutil.ORBConstants; //导入依赖的package包/类
protected void sendHelper(GIOPVersion giopVersion, Message msg)
throws IOException
{
// REVISIT: See comments in CDROutputObject constructor.
CDROutputObject outputObject =
sun.corba.OutputStreamFactory.newCDROutputObject((ORB)orb, null, giopVersion,
this, msg, ORBConstants.STREAM_FORMAT_VERSION_1);
msg.write(outputObject);
outputObject.writeTo(this);
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:SocketOrChannelConnectionImpl.java
示例17: redirectIOStreams
import com.sun.corba.se.impl.orbutil.ORBConstants; //导入依赖的package包/类
private void redirectIOStreams()
{
// redirect out and err streams
try {
String logDirName =
System.getProperty( ORBConstants.DB_DIR_PROPERTY ) +
System.getProperty("file.separator") +
ORBConstants.SERVER_LOG_DIR +
System.getProperty("file.separator");
File logDir = new File(logDirName);
String server = System.getProperty(
ORBConstants.SERVER_ID_PROPERTY ) ;
FileOutputStream foutStream =
new FileOutputStream(logDirName + server+".out", true);
FileOutputStream ferrStream =
new FileOutputStream(logDirName + server+".err", true);
PrintStream pSout = new PrintStream(foutStream, true);
PrintStream pSerr = new PrintStream(ferrStream, true);
System.setOut(pSout);
System.setErr(pSerr);
logInformation( "Server started" ) ;
} catch (Exception ex) {}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:ServerMain.java
示例18: getServerId
import com.sun.corba.se.impl.orbutil.ORBConstants; //导入依赖的package包/类
private int getServerId()
{
Integer serverId = Integer.getInteger( ORBConstants.SERVER_ID_PROPERTY ) ;
if (serverId == null)
logTerminal( "", NO_SERVER_ID ) ;
return serverId.intValue() ;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:ServerMain.java
示例19: registerCallback
import com.sun.corba.se.impl.orbutil.ORBConstants; //导入依赖的package包/类
private void registerCallback( Class serverClass )
{
Method installMethod = getNamedMethod( serverClass, "install" ) ;
Method uninstallMethod = getNamedMethod( serverClass, "uninstall" ) ;
Method shutdownMethod = getNamedMethod( serverClass, "shutdown" ) ;
Properties props = new Properties() ;
props.put( "org.omg.CORBA.ORBClass",
"com.sun.corba.se.impl.orb.ORBImpl" ) ;
// NOTE: Very important to pass this property, otherwise the
// Persistent Server registration will be unsucessfull.
props.put( ORBConstants.ACTIVATED_PROPERTY, "false" );
String args[] = null ;
ORB orb = ORB.init( args, props ) ;
ServerCallback serverObj = new ServerCallback( orb,
installMethod, uninstallMethod, shutdownMethod ) ;
int serverId = getServerId() ;
try {
Activator activator = ActivatorHelper.narrow(
orb.resolve_initial_references( ORBConstants.SERVER_ACTIVATOR_NAME ));
activator.active(serverId, serverObj);
} catch (Exception ex) {
logTerminal( "exception " + ex.getMessage(),
REGISTRATION_FAILED ) ;
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:ServerMain.java
示例20: main
import com.sun.corba.se.impl.orbutil.ORBConstants; //导入依赖的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();
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:RepositoryImpl.java
注:本文中的com.sun.corba.se.impl.orbutil.ORBConstants类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论