Refine search
return (new org.omg.CosNaming.NameComponent(id.toString(), kind.toString()));
public synchronized void registerName(String nameId, String nameKind) throws NotFound, CannotProceed, InvalidName, org.omg.CORBA.ORBPackage.InvalidName { if (nameId == null) { return; } namingContext_ = NamingContextHelper.narrow(getORB().resolve_initial_references("NameService")); NameComponent[] _name = new NameComponent[] { new NameComponent(nameId, nameKind) }; if (logger_.isInfoEnabled()) { logger_.info("namingContext.rebind(" + format(_name) + " => " + getCorbaLoc() + ")"); } namingContext_.rebind(_name, thisRef_); registeredName_ = _name; }
public SerialContextProvider getNameService() throws InvalidName, NotFound, CannotProceed, org.omg.CosNaming.NamingContextPackage.InvalidName { org.omg.CORBA.Object objref = null; if (endpoints == null) { objref = orb.resolve_initial_references( "NameService"); } else { objref = orb.string_to_object(endpoints) ; } final NamingContext nctx = NamingContextHelper.narrow(objref); final NameComponent[] path = { new NameComponent("SerialContextProvider", "") }; final org.omg.CORBA.Object obj = nctx.resolve(path) ; SerialContextProvider result = (SerialContextProvider)PortableRemoteObject.narrow( obj, SerialContextProvider.class ); return result ; }
orb = org.omg.CORBA.ORB.init(args, p); log.debug(" inited orb"); log.debug(" resolving NameService"); nce = NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService")); log.debug("NamingContextExt is " + nce); root_poa = POAHelper.narrow(orb.resolve_initial_references("RootPOA")); log.debug("roo_poa is " + root_poa); root_poa.the_POAManager().activate(); log.debug(" creating NamingContext"); NameComponent[] aNameComponentArray = new NameComponent[1]; aNameComponentArray[0] = new NameComponent(namingContextExt, ""); nc = nce.bind_new_context(aNameComponentArray); log.debug(" created NamingContext"); log.debug("NamingContext Object is " + aObject); nc = NamingContextHelper.narrow(aObject);
public static void main( String[] args ) org.omg.CORBA.ORB.init(args, null); logger = ((org.jacorb.orb.ORB)orb).getConfiguration().getLogger("org.jacorb.tx_service"); org.omg.PortableServer.POAHelper.narrow(orb.resolve_initial_references("RootPOA")); poa.the_POAManager().activate(); ps.println( orb.object_to_string( transactionService.get_reference() ) ); ps.close(); NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService")); NameComponent [] name = new NameComponent[1]; name[0] = new NameComponent( "TransactionService", "service"); nc.bind(name, transactionService.get_reference());
public void registerServant(String uri, Object servantObject) throws CorbaHostException { CorbanameURL details = CorbaHostUtils.getServiceDetails(uri); ORB orb = createORB(details.getHost(), details.getPort(), false); try { NamingContext namingCtx = getNamingContext(orb, details.getNameService()); for (int i = 0; i < details.getNamePath().size() - 1; i++) { NameComponent nc = new NameComponent(details.getNamePath().get(i), ""); NameComponent[] path = new NameComponent[] {nc}; try { namingCtx = NamingContextHelper.narrow(namingCtx.resolve(path)); } catch (Exception e) { namingCtx = namingCtx.bind_new_context(path); } } NameComponent finalName = new NameComponent(details.getNamePath().get(details.getNamePath().size() - 1), ""); try { namingCtx.resolve(new NameComponent[] {finalName}); // no exception means that some object is already registered // under this name, we need to crash here throw new CorbaHostException(CorbaHostException.BINDING_IN_USE); } catch (NotFound e) { namingCtx.bind(new NameComponent[] {finalName}, servantObject); } } catch (CorbaHostException e) { throw e; } catch (Exception e) { handleException(e); } }
@Override public void initializeRemoteNaming(Remote remoteNamingProvider) throws Exception { try { org.omg.CORBA.Object provider = getRemoteNamingReference( remoteNamingProvider ) ; // put object in NameService org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService"); NamingContext ncRef = NamingContextHelper.narrow(objRef); // XXX use constant for SerialContextProvider name NameComponent nc = new NameComponent("SerialContextProvider", ""); NameComponent path[] = {nc}; ncRef.rebind(path, provider); } catch (Exception ex) { _logger.log(Level.SEVERE, "enterprise_naming.excep_in_insertserialcontextprovider",ex); RemoteException re = new RemoteException("initSerialCtxProvider error", ex); throw re; } }
/**Request the transaction service to stop any further transactional activity. * * @param immediate Indicates whether to ignore running transactions. * * @return * * @see */ public static void shutdown( boolean immediate ) { // Remove the admin and factory objects from the naming service. if( namingContext != null ) try { NameComponent nc = new NameComponent(TransactionFactoryHelper.id(),""); NameComponent path[] = {nc}; namingContext.unbind(path); namingContext = null; } catch( Exception exc ) {} // Inform the local TransactionFactory and CurrentImpl classes that no more // transactional activity may occur. TransactionFactoryImpl.deactivate(); CurrentImpl.deactivate(); // Shut down the basic transaction services. currentInstance.shutdown(immediate); // Discard the factory and current instances. currentInstance = null; factoryInstance = null; //adminInstance = null; active = false; }
org.omg.CORBA.Object initServ = _orb.orb().resolve_initial_references(Services.nameService); NamingContext rootContext = NamingContextHelper.narrow(initServ); NameComponent[] contextName = new NameComponent[1]; contextName[0] = new NameComponent(serviceName, kind); rootContext.rebind(contextName, objRef); String configFile = cosservicesRoot+File.separatorChar+configLocation; LineNumberReader input = null; String objString = _orb.orb().object_to_string(objRef); File currFile = null; String newFileName = configFile+Services.tmpFile; ofile = new FileOutputStream(serviceName); String objString = _orb.orb().object_to_string(objRef); byte b[] = objString.getBytes(StandardCharsets.UTF_8);
public SerialContextProvider getNameService() throws InvalidName, NotFound, CannotProceed, org.omg.CosNaming.NamingContextPackage.InvalidName { org.omg.CORBA.Object objref = null; if (endpoints == null) { objref = orb.resolve_initial_references( "NameService"); } else { objref = orb.string_to_object(endpoints) ; } final NamingContext nctx = NamingContextHelper.narrow(objref); final NameComponent[] path = { new NameComponent("SerialContextProvider", "") }; final org.omg.CORBA.Object obj = nctx.resolve(path) ; SerialContextProvider result = (SerialContextProvider)PortableRemoteObject.narrow( obj, SerialContextProvider.class ); return result ; }
orbProps.put("org.omg.CORBA.ORBInitialHost", orbInitialHost); orbProps.put("org.omg.CORBA.ORBInitialPort", orbInitialPort); ORB orb = ORB.init(new String[0], orbProps); NamingContext root = NamingContextHelper.narrow(orb.resolve_initial_references("NameService")); NameComponent nc = new NameComponent(nameId, nameKind); NameComponent[] ncs = {nc}; org.omg.CORBA.Object corbaObject = root.resolve(ncs);
org.omg.CORBA.Object initServ = _orb.orb().resolve_initial_references(Services.nameService); NamingContext rootContext = NamingContextHelper.narrow(initServ); NameComponent[] contextName = new NameComponent[1]; contextName[0] = new NameComponent(serviceName, kind); rootContext.rebind(contextName, objRef); String configFile = cosservicesRoot+File.separatorChar+configLocation; LineNumberReader input = null; String objString = _orb.orb().object_to_string(objRef); File currFile = null; String newFileName = configFile+Services.tmpFile; ofile = new FileOutputStream(serviceName); String objString = _orb.orb().object_to_string(objRef); byte b[] = objString.getBytes(StandardCharsets.UTF_8);
objRef = _orb.orb().resolve_initial_references(serviceName); org.omg.CORBA.Object nsRef = _orb.orb().resolve_initial_references(Services.nameService); NamingContext ncRef = NamingContextHelper.narrow(nsRef); NameComponent nc = new NameComponent(serviceName, kind); NameComponent path[] = {nc}; objRef = ncRef.resolve(path); objRef = _orb.orb().string_to_object(ior);
orbProps.put("org.omg.CORBA.ORBInitialHost", orbInitialHost); orbProps.put("org.omg.CORBA.ORBInitialPort", orbInitialPort); ORB orb = ORB.init(new String[0], orbProps); NamingContext root = NamingContextHelper.narrow(orb.resolve_initial_references("NameService")); NameComponent nc = new NameComponent(nameId, nameKind); NameComponent[] ncs = {nc}; org.omg.CORBA.Object corbaObject = root.resolve(ncs);
new NameComponent(new String(id, 0, idCount), new String(kind, 0, kindCount))));
namingContext = NamingContextHelper.narrow( Configuration.getORB().resolve_initial_references("NameService"/*#Frozen*/)); } catch (Exception exc) { _logger.log(Level.WARNING,"jts.orb_not_running"); NameComponent nc = new NameComponent(TransactionFactoryHelper.id(), ""); NameComponent path[] = { nc }; namingContext.rebind(path, thisRef); } catch (Exception exc) { _logger.log(Level.WARNING,"jts.cannot_register_with_orb",
objRef = _orb.orb().resolve_initial_references(serviceName); org.omg.CORBA.Object nsRef = _orb.orb().resolve_initial_references(Services.nameService); NamingContext ncRef = NamingContextHelper.narrow(nsRef); NameComponent nc = new NameComponent(serviceName, kind); NameComponent path[] = {nc}; objRef = ncRef.resolve(path); objRef = _orb.orb().string_to_object(ior);
orbProps.put("org.omg.CORBA.ORBInitialHost", orbInitialHost); orbProps.put("org.omg.CORBA.ORBInitialPort", orbInitialPort); ORB orb = ORB.init(new String[0], orbProps); NamingContext root = NamingContextHelper.narrow(orb.resolve_initial_references("NameService")); NameComponent nc = new NameComponent(nameId, nameKind); NameComponent[] ncs = {nc}; org.omg.CORBA.Object corbaObject = root.resolve(ncs);
NameComponent comp = new NameComponent(); int kindSep = -1; int len = compStr.length();
org.omg.CORBA.Object initServ = _orb.orb().resolve_initial_references(Services.nameService); NamingContext rootContext = NamingContextHelper.narrow(initServ); NameComponent[] contextName = new NameComponent[1]; contextName[0] = new NameComponent(serviceName, kind); rootContext.rebind(contextName, objRef); String configFile = cosservicesRoot+File.separatorChar+configLocation; LineNumberReader input = null; String objString = _orb.orb().object_to_string(objRef); File currFile = null; String newFileName = configFile+Services.tmpFile; ofile = new FileOutputStream(serviceName); String objString = _orb.orb().object_to_string(objRef); byte b[] = objString.getBytes();