当前位置: 首页>>代码示例>>Java>>正文


Java NamingContextExtHelper类代码示例

本文整理汇总了Java中org.omg.CosNaming.NamingContextExtHelper的典型用法代码示例。如果您正苦于以下问题:Java NamingContextExtHelper类的具体用法?Java NamingContextExtHelper怎么用?Java NamingContextExtHelper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


NamingContextExtHelper类属于org.omg.CosNaming包,在下文中一共展示了NamingContextExtHelper类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDefaultNameService

import org.omg.CosNaming.NamingContextExtHelper; //导入依赖的package包/类
/**
 * Get the default naming service for the case when there no NameService
 * entries.
 */
protected org.omg.CORBA.Object getDefaultNameService()
{
  if (initial_references.containsKey(NAME_SERVICE))
    return (org.omg.CORBA.Object) initial_references.get(NAME_SERVICE);

  IOR ior = new IOR();
  ior.Id = NamingContextExtHelper.id();
  ior.Internet.host = ns_host;
  ior.Internet.port = ns_port;
  ior.key = NamingServiceTransient.getDefaultKey();

  IorObject iorc = new IorObject(this, ior);
  NamingContextExt namer = NamingContextExtHelper.narrow(iorc);
  initial_references.put(NAME_SERVICE, namer);
  return namer;
}
 
开发者ID:vilie,项目名称:javify,代码行数:21,代码来源:OrbFunctional.java

示例2: resolveCorbaname

import org.omg.CosNaming.NamingContextExtHelper; //导入依赖的package包/类
/**
 *  resolves a corbaname: url that is encapsulated in a CorbanameURL object.
 *
 *  @return the CORBA.Object if resolution is successful
 */
private org.omg.CORBA.Object resolveCorbaname( CorbanameURL theCorbaName ) {
    org.omg.CORBA.Object result = null;

    try {
        NamingContextExt theNamingContext = null;

        if( theCorbaName.getRIRFlag( ) ) {
            // Case 1 of corbaname: rir#
            theNamingContext = getDefaultRootNamingContext( );
        } else {
            // Case 2 of corbaname: ::hostname#
            org.omg.CORBA.Object corbalocResult =
                getIORUsingCorbaloc( theCorbaName );
            if( corbalocResult == null ) {
                return null;
            }

            theNamingContext =
                NamingContextExtHelper.narrow( corbalocResult );
        }

        String StringifiedName = theCorbaName.getStringifiedName( );

        if( StringifiedName == null ) {
            // This means return the Root Naming context
            return theNamingContext;
        } else {
            return theNamingContext.resolve_str( StringifiedName );
        }
    } catch( Exception e ) {
        clearRootNamingContextCache( );
        return null;
    }
 }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:40,代码来源:INSURLOperationImpl.java

示例3: getDefaultRootNamingContext

import org.omg.CosNaming.NamingContextExtHelper; //导入依赖的package包/类
/**
 *  This is required for corbaname: resolution. Currently we
 *  are not caching RootNamingContext as the reference to rootNamingContext
 *  may not be Persistent in all the implementations.
 *  _REVISIT_ to clear the rootNamingContext in case of COMM_FAILURE.
 *
 *  @return the org.omg.COSNaming.NamingContextExt if resolution is
 *   successful
 *
 */
private NamingContextExt getDefaultRootNamingContext( ) {
    synchronized( rootContextCacheLock ) {
        if( rootNamingContextExt == null ) {
            try {
                rootNamingContextExt =
                    NamingContextExtHelper.narrow(
                    orb.getLocalResolver().resolve( "NameService" ) );
            } catch( Exception e ) {
                rootNamingContextExt = null;
            }
        }
    }
    return rootNamingContextExt;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:INSURLOperationImpl.java

示例4: resolveObject

import org.omg.CosNaming.NamingContextExtHelper; //导入依赖的package包/类
public static org.omg.CORBA.Object resolveObject(AxisService service, org.omg.CORBA_2_3.ORB orb) throws CorbaInvocationException {
    org.omg.CORBA.Object obj;
    try {
        Parameter namingServiceUrl = service.getParameter(NAMING_SERVICE_URL);
        Parameter objectName = service.getParameter(OBJECT_NAME);
        Parameter iorFilePath = service.getParameter(IOR_FILE_PATH);
        Parameter iorString = service.getParameter(IOR_STRING);

        if (namingServiceUrl!=null && objectName!=null) {
            obj = orb.string_to_object(((String) namingServiceUrl.getValue()).trim());
            NamingContextExt nc = NamingContextExtHelper.narrow(obj);
            obj = nc.resolve(nc.to_name(((String) objectName.getValue()).trim()));
        } else if (iorFilePath!=null) {
            FileReader fileReader = new FileReader(((String) iorFilePath.getValue()).trim());
            char[] buf = new char[1000];
            fileReader.read(buf);
            obj = orb.string_to_object((new String(buf)).trim());
            fileReader.close();
        } else if (iorString!=null) {
            obj = orb.string_to_object(((String) iorString.getValue()).trim());
        } else {
            throw new CorbaInvocationException("cannot resolve object");
        }

    } catch (NotFound notFound) {
        throw new CorbaInvocationException("cannot resolve object", notFound);
    } catch (CannotProceed cannotProceed) {
        throw new CorbaInvocationException("cannot resolve object", cannotProceed);
    } catch (InvalidName invalidName) {
        throw new CorbaInvocationException("cannot resolve object", invalidName);
    } catch (IOException e) {
        throw new CorbaInvocationException("cannot resolve object", e);
    }
    return obj;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:36,代码来源:CorbaUtil.java


注:本文中的org.omg.CosNaming.NamingContextExtHelper类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。