return new ContextResult(NamingUtils.emptyContext(getEnvironment()), false);
try (Marshaller marshaller = createMarshaller(messageOutputStream, configuration)) { marshaller.writeByte(Protocol.P_NAME); marshaller.writeObject(NamingUtils.toDecomposedCompositeName(name)); messageOutputStream.writeUTF(NamingUtils.toCompositeName(name).toString()); final int parameterType = is.readUnsignedByte(); if (parameterType == Protocol.P_CONTEXT) { return new RelativeFederatingContext(new FastHashtable<>(context.getEnvironment()), context, NamingUtils.toCompositeName(name)); } else if (parameterType == Protocol.P_OBJECT) { try (Unmarshaller unmarshaller = createUnmarshaller(is, configuration)) { throw (NamingException) exception; } else { throw namingException("Failed to lookup", exception); throw namingException("Failed to lookup", e); } catch (IOException e) { throw Messages.log.operationFailed(e);
public NameParser getNameParser(final CompositeName compositeName) throws NamingException { if (compositeName.isEmpty()) { return getNativeNameParser(); } final String first = compositeName.get(0); final Name nativeName = getNativeNameParser().parse(first); final Object obj = lookup(nativeName); if (obj instanceof Context) { final Context context = (Context) obj; try { return context.getNameParser(compositeName.getSuffix(1)); } finally { safeClose(context); } } else { throw log.notContextInCompositeName(first); } } }
try (Marshaller marshaller = createMarshaller(messageOutputStream, configuration)) { marshaller.writeByte(Protocol.P_NAME); marshaller.writeObject(NamingUtils.toDecomposedCompositeName(oldName)); marshaller.writeByte(Protocol.P_NAME); marshaller.writeObject(NamingUtils.toDecomposedCompositeName(newName)); messageOutputStream.writeUTF(NamingUtils.toCompositeName(oldName).toString()); messageOutputStream.writeUTF(NamingUtils.toCompositeName(newName).toString());
protected Context createSubcontextNative(final Name name) throws NamingException { Name realName = getRealName(name); ProviderEnvironment environment = provider.getProviderEnvironment(); final RetryContext context = canRetry(environment) ? new RetryContext() : null; return performWithRetry((context_, name_, ignored) -> { final ConnectionPeerIdentity peerIdentity = provider.getPeerIdentityForNamingUsingRetry(context_); final CompositeName compositeName = NamingUtils.toCompositeName(name_); getRemoteTransport(peerIdentity).createSubcontext(compositeName, peerIdentity); return new RelativeFederatingContext(getEnvironment(), this, compositeName); }, environment, context, realName, null); }
try (Marshaller marshaller = createMarshaller(messageOutputStream, configuration)) { marshaller.writeByte(Protocol.P_NAME); marshaller.writeObject(NamingUtils.toDecomposedCompositeName(name)); messageOutputStream.writeUTF(NamingUtils.toCompositeName(name).toString());
protected Context createSubcontextNative(final Name name) throws NamingException { Name realName = getRealName(name); ProviderEnvironment environment = provider.getProviderEnvironment(); final RetryContext context = canRetry(environment) ? new RetryContext() : null; return performWithRetry((context_, name_, ignored) -> { final ConnectionPeerIdentity peerIdentity = provider.getPeerIdentityForNamingUsingRetry(context_); final CompositeName compositeName = NamingUtils.toCompositeName(name_); getRemoteTransport(peerIdentity).createSubcontext(compositeName, peerIdentity); return new RelativeFederatingContext(getEnvironment(), this, compositeName); }, environment, context, realName, null); }
throw Messages.log.connectionSharingUnsupported(); final CompositeName compositeName = NamingUtils.toCompositeName(name); try { try (MessageOutputStream messageOutputStream = tracker.allocateMessage(invocation)) { try (Marshaller marshaller = createMarshaller(messageOutputStream, configuration)) { marshaller.writeByte(Protocol.P_NAME); marshaller.writeObject(NamingUtils.toDecomposedCompositeName(name)); throw namingException("Failed to lookup", e); } catch (IOException e) { throw Messages.log.operationFailed(e);
try (Marshaller marshaller = createMarshaller(messageOutputStream, configuration)) { marshaller.writeByte(Protocol.P_NAME); marshaller.writeObject(NamingUtils.toDecomposedCompositeName(name)); messageOutputStream.writeUTF(NamingUtils.toCompositeName(name).toString());
public Object lookup(final Name name) throws NamingException { Assert.checkNotNullParam("name", name); if (name instanceof CompositeName) { if (name.isEmpty()) { return lookupNative(new SimpleName()); } final String first = name.get(0); final Object next = lookup(getNativeNameParser().parse(first)); if (name.size() == 1) { return next; } else if (next instanceof Context) { final Context context = (Context) next; try { return context.lookup(name.getSuffix(1)); } finally { NamingUtils.safeClose(context); } } else { throw log.notContextInCompositeName(first); } } else { return lookupNative(name); } }
protected Context createSubcontextNative(final Name name) throws NamingException { Name realName = getRealName(name); ProviderEnvironment environment = provider.getProviderEnvironment(); final RetryContext context = canRetry(environment) ? new RetryContext() : null; return performWithRetry((context_, name_, ignored) -> { final ConnectionPeerIdentity peerIdentity = provider.getPeerIdentityForNamingUsingRetry(context_); final CompositeName compositeName = NamingUtils.toCompositeName(name_); getRemoteTransport(peerIdentity).createSubcontext(compositeName, peerIdentity); return new RelativeFederatingContext(getEnvironment(), this, compositeName); }, environment, context, realName, null); }
return new ContextResult(NamingUtils.emptyContext(getEnvironment()), false);
final CompositeName compositeName = NamingUtils.toCompositeName(name); try { try (MessageOutputStream messageOutputStream = tracker.allocateMessage(invocation)) { try (Marshaller marshaller = createMarshaller(messageOutputStream, configuration)) { marshaller.writeByte(Protocol.P_NAME); marshaller.writeObject(NamingUtils.toDecomposedCompositeName(name)); throw namingException("Failed to lookup", e); } catch (IOException e) { throw Messages.log.operationFailed(e);
try (Marshaller marshaller = createMarshaller(messageOutputStream, configuration)) { marshaller.writeByte(Protocol.P_NAME); marshaller.writeObject(NamingUtils.toDecomposedCompositeName(name)); marshaller.writeByte(Protocol.P_OBJECT); marshaller.writeObject(obj); messageOutputStream.writeUTF(NamingUtils.toCompositeName(name).toString()); try (Marshaller marshaller = createMarshaller(messageOutputStream, configuration)) { marshaller.writeObject(obj);
public void unbind(final Name name) throws NamingException { Assert.checkNotNullParam("name", name); if (name.isEmpty()) { throw log.invalidEmptyName(); } if (name instanceof CompositeName) { final String first = name.get(0); final Name firstName = getNativeNameParser().parse(first); if (name.size() == 1) { unbindNative(firstName); return; } final Object next = lookup(firstName); if (next instanceof Context) { final Context context = (Context) next; try { context.unbind(name.getSuffix(1)); } finally { NamingUtils.safeClose(context); } } else { throw log.notContextInCompositeName(first); } } else { unbindNative(name); } }
return new ContextResult(NamingUtils.emptyContext(getEnvironment()), false);
try (Marshaller marshaller = createMarshaller(messageOutputStream, configuration)) { marshaller.writeByte(Protocol.P_NAME); marshaller.writeObject(NamingUtils.toDecomposedCompositeName(name)); messageOutputStream.writeUTF(NamingUtils.toCompositeName(name).toString()); final int parameterType = is.readUnsignedByte(); if (parameterType == Protocol.P_CONTEXT) { return new RelativeFederatingContext(new FastHashtable<>(context.getEnvironment()), context, NamingUtils.toCompositeName(name)); } else if (parameterType == Protocol.P_OBJECT) { try (Unmarshaller unmarshaller = createUnmarshaller(is, configuration)) { throw (NamingException) exception; } else { throw namingException("Failed to lookup", exception); throw namingException("Failed to lookup", e); } catch (IOException e) { throw Messages.log.operationFailed(e);
try (Marshaller marshaller = createMarshaller(messageOutputStream, configuration)) { marshaller.writeByte(Protocol.P_NAME); marshaller.writeObject(NamingUtils.toDecomposedCompositeName(oldName)); marshaller.writeByte(Protocol.P_NAME); marshaller.writeObject(NamingUtils.toDecomposedCompositeName(newName)); messageOutputStream.writeUTF(NamingUtils.toCompositeName(oldName).toString()); messageOutputStream.writeUTF(NamingUtils.toCompositeName(newName).toString());
public void bind(final Name name, final Object obj) throws NamingException { Assert.checkNotNullParam("name", name); if (name.isEmpty()) { throw log.invalidEmptyName(); } if (name instanceof CompositeName) { final String first = name.get(0); final Name firstName = getNativeNameParser().parse(first); if (name.size() == 1) { bindNative(firstName, obj); return; } final Object next = lookup(firstName); if (next instanceof Context) { final Context context = (Context) next; try { context.bind(name.getSuffix(1), obj); } finally { NamingUtils.safeClose(context); } } else { throw log.notContextInCompositeName(first); } } else { bindNative(name, obj); } }
try (Marshaller marshaller = createMarshaller(messageOutputStream, configuration)) { marshaller.writeByte(Protocol.P_NAME); marshaller.writeObject(NamingUtils.toDecomposedCompositeName(name)); messageOutputStream.writeUTF(NamingUtils.toCompositeName(name).toString()); final int parameterType = is.readUnsignedByte(); if (parameterType == Protocol.P_CONTEXT) { return new RelativeFederatingContext(new FastHashtable<>(context.getEnvironment()), context, NamingUtils.toCompositeName(name)); } else if (parameterType == Protocol.P_OBJECT) { try (Unmarshaller unmarshaller = createUnmarshaller(is, configuration)) { throw (NamingException) exception; } else { throw namingException("Failed to lookup", exception); throw namingException("Failed to lookup", e); } catch (IOException e) { throw Messages.log.operationFailed(e);