本文整理汇总了Java中com.sun.corba.se.spi.ior.IOR类的典型用法代码示例。如果您正苦于以下问题:Java IOR类的具体用法?Java IOR怎么用?Java IOR使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IOR类属于com.sun.corba.se.spi.ior包,在下文中一共展示了IOR类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: serverPIHandleExceptions
import com.sun.corba.se.spi.ior.IOR; //导入依赖的package包/类
/**
* Handles exceptions for the starting and intermediate points for
* server request interceptors. This is common code that has been
* factored out into this utility method.
* <p>
* This method will NOT work for ending points.
*/
private void serverPIHandleExceptions( ServerRequestInfoImpl info )
{
int endingPointCall = info.getEndingPointCall();
if(endingPointCall == ServerRequestInfoImpl.CALL_SEND_EXCEPTION) {
// If a system exception was thrown, throw it to caller:
throw (SystemException)info.getException();
}
else if( (endingPointCall == ServerRequestInfoImpl.CALL_SEND_OTHER) &&
(info.getForwardRequestException() != null) )
{
// If an interceptor throws a forward request, convert it
// into a ForwardException for easier handling:
IOR ior = info.getForwardRequestIOR();
throw new ForwardException( orb, ior );
}
}
示例2: LocalClientRequestDispatcherBase
import com.sun.corba.se.spi.ior.IOR; //导入依赖的package包/类
protected LocalClientRequestDispatcherBase(ORB orb, int scid, IOR ior)
{
this.orb = orb ;
TaggedProfile prof = ior.getProfile() ;
servantIsLocal = orb.getORBData().isLocalOptimizationAllowed() &&
prof.isLocal();
ObjectKeyTemplate oktemp = prof.getObjectKeyTemplate() ;
this.scid = oktemp.getSubcontractId() ;
RequestDispatcherRegistry sreg = orb.getRequestDispatcherRegistry() ;
oaf = sreg.getObjectAdapterFactory( scid ) ;
oaid = oktemp.getObjectAdapterId() ;
ObjectId oid = prof.getObjectId() ;
objectId = oid.getId() ;
}
示例3: addRemoteContactInfos
import com.sun.corba.se.spi.ior.IOR; //导入依赖的package包/类
protected void addRemoteContactInfos(
IOR effectiveTargetIOR,
List effectiveTargetIORContactInfoList)
{
ContactInfo contactInfo;
List socketInfos = orb.getORBData()
.getIORToSocketInfo().getSocketInfo(effectiveTargetIOR);
Iterator iterator = socketInfos.iterator();
while (iterator.hasNext()) {
SocketInfo socketInfo = (SocketInfo) iterator.next();
String type = socketInfo.getType();
String host = socketInfo.getHost().toLowerCase();
int port = socketInfo.getPort();
contactInfo = createContactInfo(type, host, port);
effectiveTargetIORContactInfoList.add(contactInfo);
}
}
示例4: equals
import com.sun.corba.se.spi.ior.IOR; //导入依赖的package包/类
/**
* This method overrides the org.omg.CORBA.portable.Delegate.equals method,
* and does the equality check based on IOR equality.
*/
public boolean equals(org.omg.CORBA.Object self, java.lang.Object other)
{
if (other == null)
return false ;
if (!StubAdapter.isStub(other)) {
return false;
}
Delegate delegate = StubAdapter.getDelegate( other ) ;
if (delegate == null)
return false ;
if (delegate instanceof CorbaClientDelegateImpl) {
CorbaClientDelegateImpl otherDel = (CorbaClientDelegateImpl)
delegate ;
IOR otherIor = otherDel.contactInfoList.getTargetIOR();
return this.contactInfoList.getTargetIOR().equals(otherIor);
}
// Come here if other is not implemented by our ORB.
return false;
}
示例5: forward_reference
import com.sun.corba.se.spi.ior.IOR; //导入依赖的package包/类
/**
* See RequestInfoImpl for javadoc.
*/
public Object forward_reference (){
checkAccess( MID_FORWARD_REFERENCE );
// Check to make sure we are in LOCATION_FORWARD
// state as per ptc/00-08-06, table 21-1
// footnote 2.
if( replyStatus != LOCATION_FORWARD.value ) {
throw stdWrapper.invalidPiCall1() ;
}
// Do not cache this value since if an interceptor raises
// forward request then the next interceptor in the
// list should see the new value.
IOR ior = getLocatedIOR();
return iorToObject(ior);
}
示例6: BootstrapResolverImpl
import com.sun.corba.se.spi.ior.IOR; //导入依赖的package包/类
public BootstrapResolverImpl(ORB orb, String host, int port) {
wrapper = ORBUtilSystemException.get( orb,
CORBALogDomains.ORB_RESOLVER ) ;
// Create a new IOR with the magic of INIT
byte[] initialKey = "INIT".getBytes() ;
ObjectKey okey = orb.getObjectKeyFactory().create(initialKey) ;
IIOPAddress addr = IIOPFactories.makeIIOPAddress( orb, host, port ) ;
IIOPProfileTemplate ptemp = IIOPFactories.makeIIOPProfileTemplate(
orb, GIOPVersion.V1_0, addr);
IORTemplate iortemp = IORFactories.makeIORTemplate( okey.getTemplate() ) ;
iortemp.add( ptemp ) ;
IOR initialIOR = iortemp.makeIOR( (com.sun.corba.se.spi.orb.ORB)orb,
"", okey.getId() ) ;
bootstrapDelegate = ORBUtility.makeClientDelegate( initialIOR ) ;
}
示例7: connectAndGetIOR
import com.sun.corba.se.spi.ior.IOR; //导入依赖的package包/类
/** Obtains an IOR for the object reference obj, first connecting it to
* the ORB if necessary.
* @return IOR the IOR that represents this objref. This will
* never be null.
* @exception BAD_OPERATION if the object could not be connected,
* if a connection attempt was needed.
* @exception BAD_PARAM if obj is a local object, or else was
* created by a foreign ORB.
*/
public static IOR connectAndGetIOR( ORB orb, org.omg.CORBA.Object obj )
{
IOR result ;
try {
result = getIOR( obj ) ;
} catch (BAD_OPERATION bop) {
if (StubAdapter.isStub(obj)) {
try {
StubAdapter.connect( obj, orb ) ;
} catch (java.rmi.RemoteException exc) {
throw wrapper.connectingServant( exc ) ;
}
} else {
orb.connect( obj ) ;
}
result = getIOR( obj ) ;
}
return result ;
}
示例8: updateClientRequestDispatcherForward
import com.sun.corba.se.spi.ior.IOR; //导入依赖的package包/类
/**
* Update the client delegate in the event of a ForwardRequest, given the
* information in the passed-in info object.
*/
private void updateClientRequestDispatcherForward(
ClientRequestInfoImpl info )
{
ForwardRequest forwardRequest = info.getForwardRequestException();
// ForwardRequest may be null if the forwarded IOR is set internal
// to the ClientRequestDispatcher rather than explicitly through Portable
// Interceptors. In this case, we need not update the client
// delegate ForwardRequest object.
if( forwardRequest != null ) {
org.omg.CORBA.Object object = forwardRequest.forward;
// Convert the forward object into an IOR:
IOR ior = ORBUtility.getIOR( object ) ;
info.setLocatedIOR( ior );
}
}
示例9: createLocateReply
import com.sun.corba.se.spi.ior.IOR; //导入依赖的package包/类
public static LocateReplyMessage createLocateReply(
ORB orb, GIOPVersion gv, byte encodingVersion,
int request_id, int locate_status, IOR ior) {
if (gv.equals(GIOPVersion.V1_0)) { // 1.0
return new LocateReplyMessage_1_0(orb, request_id,
locate_status, ior);
} else if (gv.equals(GIOPVersion.V1_1)) { // 1.1
return new LocateReplyMessage_1_1(orb, request_id,
locate_status, ior);
} else if (gv.equals(GIOPVersion.V1_2)) { // 1.2
LocateReplyMessage msg =
new LocateReplyMessage_1_2(orb, request_id,
locate_status, ior);
msg.setEncodingVersion(encodingVersion);
return msg;
} else {
throw wrapper.giopVersionError(
CompletionStatus.COMPLETED_MAYBE);
}
}
示例10: locate
import com.sun.corba.se.spi.ior.IOR; //导入依赖的package包/类
/** XXX/REVISIT:
* We do not want to look for a servant in the POA/ServantManager case,
* but we could in most other cases. The OA could have a method that
* returns true if the servant MAY exist, and false only if the servant
* definitely DOES NOT exist.
*
* XXX/REVISIT:
* We may wish to indicate OBJECT_HERE by some mechanism other than
* returning a null result.
*
* Called from ORB.locate when a LocateRequest arrives.
* Result is not always absolutely correct: may indicate OBJECT_HERE
* for non-existent objects, which is resolved on invocation. This
* "bug" is unavoidable, since in general the object may be destroyed
* between a locate and a request. Note that this only checks that
* the appropriate ObjectAdapter is available, not that the servant
* actually exists.
* Need to signal one of OBJECT_HERE, OBJECT_FORWARD, OBJECT_NOT_EXIST.
* @return Result is null if object is (possibly) implemented here, otherwise
* an IOR indicating objref to forward the request to.
* @exception OBJECT_NOT_EXIST is thrown if we know the object does not
* exist here, and we are not forwarding.
*/
public IOR locate(ObjectKey okey)
{
try {
if (orb.subcontractDebugFlag)
dprint(".locate->");
ObjectKeyTemplate oktemp = okey.getTemplate() ;
try {
checkServerId(okey);
} catch (ForwardException fex) {
return fex.getIOR() ;
}
// Called only for its side-effect of throwing appropriate exceptions
findObjectAdapter(oktemp);
return null ;
} finally {
if (orb.subcontractDebugFlag)
dprint(".locate<-");
}
}
示例11: getStreamFormatVersionForThisRequest
import com.sun.corba.se.spi.ior.IOR; //导入依赖的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);
}
示例12: chooseRequestVersion
import com.sun.corba.se.spi.ior.IOR; //导入依赖的package包/类
/**
* This chooses the appropriate GIOP version.
*
* @return the GIOP version 13.00 if Java serialization is enabled, or
* smallest(profGIOPVersion, orbGIOPVersion)
*/
public static GIOPVersion chooseRequestVersion(ORB orb, IOR ior ) {
GIOPVersion orbVersion = orb.getORBData().getGIOPVersion();
IIOPProfile prof = ior.getProfile() ;
GIOPVersion profVersion = prof.getGIOPVersion();
// Check if the profile is from a legacy Sun ORB.
ORBVersion targetOrbVersion = prof.getORBVersion();
if (!(targetOrbVersion.equals(ORBVersionFactory.getFOREIGN())) &&
targetOrbVersion.lessThan(ORBVersionFactory.getNEWER())) {
// we are dealing with a SUN legacy orb which emits 1.1 IORs,
// in spite of being able to handle only GIOP 1.0 messages.
return V1_0;
}
// Now the target has to be (FOREIGN | NEWER*)
byte prof_major = profVersion.getMajor();
byte prof_minor = profVersion.getMinor();
byte orb_major = orbVersion.getMajor();
byte orb_minor = orbVersion.getMinor();
if (orb_major < prof_major) {
return orbVersion;
} else if (orb_major > prof_major) {
return profVersion;
} else { // both major version are the same
if (orb_minor <= prof_minor) {
return orbVersion;
} else {
return profVersion;
}
}
}
示例13: makeMinimalServantCacheLocalClientRequestDispatcherFactory
import com.sun.corba.se.spi.ior.IOR; //导入依赖的package包/类
public static LocalClientRequestDispatcherFactory makeMinimalServantCacheLocalClientRequestDispatcherFactory( final ORB orb )
{
return new LocalClientRequestDispatcherFactory() {
public LocalClientRequestDispatcher create( int id, IOR ior ) {
return new MinimalServantCacheLocalCRDImpl( orb, id, ior ) ;
}
} ;
}
示例14: makeInfoOnlyServantCacheLocalClientRequestDispatcherFactory
import com.sun.corba.se.spi.ior.IOR; //导入依赖的package包/类
public static LocalClientRequestDispatcherFactory makeInfoOnlyServantCacheLocalClientRequestDispatcherFactory( final ORB orb )
{
return new LocalClientRequestDispatcherFactory() {
public LocalClientRequestDispatcher create( int id, IOR ior ) {
return new InfoOnlyServantCacheLocalCRDImpl( orb, id, ior ) ;
}
} ;
}
示例15: makeJIDLLocalClientRequestDispatcherFactory
import com.sun.corba.se.spi.ior.IOR; //导入依赖的package包/类
public static LocalClientRequestDispatcherFactory makeJIDLLocalClientRequestDispatcherFactory( final ORB orb )
{
return new LocalClientRequestDispatcherFactory() {
public LocalClientRequestDispatcher create( int id, IOR ior ) {
return new JIDLLocalCRDImpl( orb, id, ior ) ;
}
} ;
}