本文整理汇总了Java中javax.rmi.CORBA.Util类的典型用法代码示例。如果您正苦于以下问题:Java Util类的具体用法?Java Util怎么用?Java Util使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Util类属于javax.rmi.CORBA包,在下文中一共展示了Util类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: unexportObject
import javax.rmi.CORBA.Util; //导入依赖的package包/类
/**
* Deregisters a server object from the runtime, allowing the object to become
* available for garbage collection.
* @param obj the object to unexport.
* @exception NoSuchObjectException if the remote object is not
* currently exported.
*/
public void unexportObject(Remote obj)
throws NoSuchObjectException {
if (obj == null) {
throw new NullPointerException("invalid argument");
}
if (StubAdapter.isStub(obj) ||
obj instanceof java.rmi.server.RemoteStub) {
throw new NoSuchObjectException(
"Can only unexport a server object.");
}
Tie theTie = Util.getTie(obj);
if (theTie != null) {
Util.unexportObject(obj);
} else {
if (Utility.loadTie(obj) == null) {
UnicastRemoteObject.unexportObject(obj,true);
} else {
throw new NoSuchObjectException("Object not exported.");
}
}
}
示例2: implementation
import javax.rmi.CORBA.Util; //导入依赖的package包/类
public String implementation (String x){
try{
// default to using the current ORB version in case the
// vhandler is not set
if (vhandler == null) {
vhandler = ValueHandlerImpl.getInstance(false);
}
// Util.getCodebase may return null which would
// cause a BAD_PARAM exception.
String result = Util.getCodebase(vhandler.getClassFromType(x));
if (result == null)
return "";
else
return result;
} catch(ClassNotFoundException cnfe){
throw wrapper.missingLocalValueImpl( CompletionStatus.COMPLETED_MAYBE,
cnfe ) ;
}
}
示例3: getMaxStreamFormatVersion
import javax.rmi.CORBA.Util; //导入依赖的package包/类
/**
* Returns the maximum stream format version supported by our
* ValueHandler.
*/
public static byte getMaxStreamFormatVersion() {
ValueHandler vh;
try {
vh = AccessController.doPrivileged(new PrivilegedExceptionAction<ValueHandler>() {
public ValueHandler run() throws Exception {
return Util.createValueHandler();
}
});
} catch (PrivilegedActionException e) {
throw new InternalError(e.getCause());
}
if (!(vh instanceof javax.rmi.CORBA.ValueHandlerMultiFormat))
return ORBConstants.STREAM_FORMAT_VERSION_1;
else
return ((ValueHandlerMultiFormat)vh).getMaximumStreamFormatVersion();
}
示例4: getMaxStreamFormatVersion
import javax.rmi.CORBA.Util; //导入依赖的package包/类
/**
* Returns the maximum stream format version supported by our
* ValueHandler.
*/
public static byte getMaxStreamFormatVersion() {
ValueHandler vh;
try {
vh = AccessController.doPrivileged(new PrivilegedExceptionAction<ValueHandler>() {
public ValueHandler run() throws Exception {
return Util.createValueHandler();
}
});
} catch (PrivilegedActionException e) {
throw new InternalError(e.getMessage());
}
if (!(vh instanceof javax.rmi.CORBA.ValueHandlerMultiFormat))
return ORBConstants.STREAM_FORMAT_VERSION_1;
else
return ((ValueHandlerMultiFormat)vh).getMaximumStreamFormatVersion();
}
示例5: createValueHandler
import javax.rmi.CORBA.Util; //导入依赖的package包/类
/**
* Creates the correct ValueHandler for the given ORB,
* querying ORBVersion information. If the ORB or
* ORBVersion is null, gets the ValueHandler from
* Util.createValueHandler.
*/
public static ValueHandler createValueHandler(ORB orb) {
if (orb == null)
return Util.createValueHandler();
ORBVersion version = orb.getORBVersion();
if (version == null)
return Util.createValueHandler();
if (version.equals(ORBVersionFactory.getOLD()))
return new ValueHandlerImpl_1_3();
if (version.equals(ORBVersionFactory.getNEW()))
return new ValueHandlerImpl_1_3_1();
return Util.createValueHandler();
}
示例6: implementation
import javax.rmi.CORBA.Util; //导入依赖的package包/类
public String implementation (String x){
try{
// default to using the current ORB version in case the
// vhandler is not set
if (vhandler == null) {
vhandler = new ValueHandlerImpl(false);
}
// Util.getCodebase may return null which would
// cause a BAD_PARAM exception.
String result = Util.getCodebase(vhandler.getClassFromType(x));
if (result == null)
return "";
else
return result;
} catch(ClassNotFoundException cnfe){
throw wrapper.missingLocalValueImpl( CompletionStatus.COMPLETED_MAYBE,
cnfe ) ;
}
}
示例7: add
import javax.rmi.CORBA.Util; //导入依赖的package包/类
/**
* includes the found extension to the corresponding fragment
*
* @param gEdge
* @param emb
* @param code
* @param edge
* @param nodeB
*/
protected void add(final GSpanEdge<NodeType, EdgeType> gEdge,
final DFSCode<NodeType, EdgeType> code,int type) {
// search corresponding extension
GSpanExtension<NodeType, EdgeType> ext = children.get(gEdge);
//~
if (ext == null) {
// create new extension
HPMutableGraph<NodeType, EdgeType> ng = (HPMutableGraph<NodeType, EdgeType>) code.getHPlistGraph().clone();
// TODO: avoid clone??
gEdge.addTo(ng); //reformulate the form of the new extended fragment!!
ext = new GSpanExtension<NodeType, EdgeType>();
ext.edge=gEdge;
ext.frag=new DFSCode<NodeType, EdgeType>(code.getSortedFreqLabels(), code.getSingleGraph(),utilities.Util.clone(code.getNonCandidates())).set((HPListGraph<NodeType, EdgeType>)ng,code.getFirst() , code.getLast(),code.getParents());
ext.frag = (DFSCode<NodeType, EdgeType>) code.extend(ext); //PUT THE STRING HERE
children.put(gEdge, ext); //TODO push into Children !!!
} else {
gEdge.release();
}
}
示例8: add
import javax.rmi.CORBA.Util; //导入依赖的package包/类
/**
* includes the found extension to the corresponding fragment
*
* @param gEdge
* @param emb
* @param code
* @param edge
* @param nodeB
*/
protected void add(final GSpanEdge<NodeType, EdgeType> gEdge,
final DFSCode<NodeType, EdgeType> code,int type) {
// search corresponding extension
GSpanExtension<NodeType, EdgeType> ext = children.get(gEdge);
//~
if (ext == null) {
// create new extension
HPMutableGraph<NodeType, EdgeType> ng = (HPMutableGraph<NodeType, EdgeType>) code.getHPlistGraph().clone();
// TODO: avoid clone??
gEdge.addTo(ng); //reformulate the form of the new extended fragment!!
ext = new GSpanExtension<NodeType, EdgeType>();
ext.edge=gEdge;
ext.frag=new DFSCode<NodeType, EdgeType>(code.getSortedFreqLabels(), code.getSingleGraph(),utilities.Util.clone(code.getNonCandidates())).set((HPListGraph<NodeType, EdgeType>)ng,code.getFirst() , code.getLast(),code.getParents());
ext.frag = (DFSCode<NodeType, EdgeType>) code.extend(ext); //PUT THE STRING HERE
children.put(gEdge, ext); //TODO push into Children !!!
} else {
gEdge.release();
}
}
示例9: add
import javax.rmi.CORBA.Util; //导入依赖的package包/类
/**
* includes the found extension to the corresponding fragment
*
* @param gEdge
* @param emb
* @param code
* @param edge
* @param nodeB
*/
protected void add(final GSpanEdge<NodeType, EdgeType> gEdge,
final DFSCode<NodeType, EdgeType> code,int type) {
// search corresponding extension
GSpanExtension<NodeType, EdgeType> ext = children.get(gEdge);
//~
if (ext == null) {
// create new extension
HPMutableGraph<NodeType, EdgeType> ng = (HPMutableGraph<NodeType, EdgeType>) code.getHPlistGraph().clone();
// TODO: avoid clone??
gEdge.addTo(ng); //reformulate the form of the new extended fragment!!
ext = new GSpanExtension<NodeType, EdgeType>();
ext.edge=gEdge;
ext.frag=new DFSCode<NodeType, EdgeType>(code.getSortedFreqLabels(), code.getSingleGraph(),utilities.Util.clone(code.getNonCandidates())).set((HPListGraph<NodeType, EdgeType>)ng,code.getFirst() , code.getLast(),code.getParents());
ext.frag = (DFSCode<NodeType, EdgeType>) code.extend(ext); //PUT THE STRING HERE
children.put(gEdge, ext); //TODO push into Children !!!
} else {
gEdge.release();
}
}
示例10: start
import javax.rmi.CORBA.Util; //导入依赖的package包/类
public void start(String[] args) throws Exception {
Properties p = System.getProperties();
p.put("org.omg.CORBA.ORBClass", "com.sun.corba.se.internal.POA.POAORB");
p.put("org.omg.CORBA.ORBSingletonClass", "com.sun.corba.se.internal.corba.ORBSingleton");
ORB orb = ORB.init(args, p);
POA rootPOA = (POA) orb.resolve_initial_references("RootPOA");
Policy[] tpolicy = new Policy[3];
tpolicy[0] = rootPOA.create_lifespan_policy(LifespanPolicyValue.TRANSIENT);
tpolicy[1] = rootPOA.create_request_processing_policy(RequestProcessingPolicyValue.USE_ACTIVE_OBJECT_MAP_ONLY);
tpolicy[2] = rootPOA.create_servant_retention_policy(ServantRetentionPolicyValue.RETAIN);
POA tPOA = rootPOA.create_POA("MyTransientPOA", null, tpolicy);
tPOA.the_POAManager().activate();
Tie tie = (Tie) Util.getTie(remoteDatabaseManager);
byte[] id = "db".getBytes();
tPOA.activate_object_with_id(id, (Servant) tie);
Context initialNamingContext = new InitialContext();
initialNamingContext.rebind("DatabaseService", tPOA.create_reference_with_id(id, ((Servant) tie)._all_interfaces(tPOA, id)[0]));
System.out.println("Database Server: Ready...");
orb.run();
}
示例11: toStub
import javax.rmi.CORBA.Util; //导入依赖的package包/类
/**
* Returns a stub for the given server object.
* @param obj the server object for which a stub is required. Must either be a subclass
* of PortableRemoteObject or have been previously the target of a call to
* {@link #exportObject}.
* @return the most derived stub for the object.
* @exception NoSuchObjectException if a stub cannot be located for the given server object.
*/
public Remote toStub (Remote obj)
throws NoSuchObjectException
{
Remote result = null;
if (obj == null) {
throw new NullPointerException("invalid argument");
}
// If the class is already an IIOP stub then return it.
if (StubAdapter.isStub( obj )) {
return obj;
}
// If the class is already a JRMP stub then return it.
if (obj instanceof java.rmi.server.RemoteStub) {
return obj;
}
// Has it been exported to IIOP?
Tie theTie = Util.getTie(obj);
if (theTie != null) {
result = Utility.loadStub(theTie,null,null,true);
} else {
if (Utility.loadTie(obj) == null) {
result = java.rmi.server.RemoteObject.toStub(obj);
}
}
if (result == null) {
throw new NoSuchObjectException("object not exported");
}
return result;
}
示例12: createStubFactory
import javax.rmi.CORBA.Util; //导入依赖的package包/类
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 ) ;
}
}
示例13: copyArguments
import javax.rmi.CORBA.Util; //导入依赖的package包/类
public Object[] copyArguments( Object[] args,
ORB orb ) throws RemoteException
{
if (needsArgumentCopy)
return Util.copyObjects( args, orb ) ;
else
return args ;
}
示例14: copyResult
import javax.rmi.CORBA.Util; //导入依赖的package包/类
public Object copyResult( Object result, ORB orb ) throws RemoteException
{
if (needsResultCopy)
return Util.copyObject( result, orb ) ;
else
return result ;
}
示例15: writeArray
import javax.rmi.CORBA.Util; //导入依赖的package包/类
private void writeArray(Serializable array, Class clazz) {
if (valueHandler == null)
valueHandler = ORBUtility.createValueHandler(); //d11638
// Write value_tag
int indirection = writeValueTag(mustChunk, true,
Util.getCodebase(clazz));
// Write repository ID
write_repositoryId(repIdStrs.createSequenceRepID(clazz));
// Add indirection for object to indirection table
updateIndirectionTable(indirection, array, array);
// Write Value chunk
if (mustChunk) {
start_block();
end_flag--;
chunkedValueNestingLevel--;
} else
end_flag--;
if (valueHandler instanceof ValueHandlerMultiFormat) {
ValueHandlerMultiFormat vh = (ValueHandlerMultiFormat)valueHandler;
vh.writeValue(parent, array, streamFormatVersion);
} else
valueHandler.writeValue(parent, array);
if (mustChunk)
end_block();
// Write end tag
writeEndTag(mustChunk);
}