/** * {@inheritDoc} */ @Override public final void bind() throws IOException { bind(getDefaultLocalAddresses()); }
/** * {@inheritDoc} */ @Override public VmPipeAddress getDefaultLocalAddress() { return (VmPipeAddress) super.getDefaultLocalAddress(); }
/** * {@inheritDoc} */ @Override public VmPipeAddress getLocalAddress() { return (VmPipeAddress) super.getLocalAddress(); }
/** * {@inheritDoc} */ public final void unbind() { unbind(getLocalAddresses()); }
if (isDisposing()) { throw new IllegalStateException("Already disposed."); checkAddressType(a); localAddressesCopy.add(a); if (getHandler() == null) { throw new IllegalStateException("handler is not set."); boundAddresses.addAll(bindInternal(localAddressesCopy)); } catch (IOException | RuntimeException e) { throw e; } catch (Throwable e) { throw new RuntimeIoException( "Failed to bind to: " + getLocalAddresses(), e); getListeners().fireServiceActivated();
@Override public String toString() { TransportMetadata m = getTransportMetadata(); return '(' + m.getProviderName() + ' ' + m.getName() + " acceptor: " + (isActive() ? "localAddress(es): " + getLocalAddresses() + ", managedSessionCount: " + getManagedSessionCount() : "not bound") + ')'; }
unbind0(localAddressesCopy); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeIoException("Failed to unbind from: " + getLocalAddresses(), e); getListeners().fireServiceDeactivated();
/** * {@inheritDoc} */ @Override public SocketAddress getLocalAddress() { Set<SocketAddress> localAddresses = getLocalAddresses(); if (localAddresses.isEmpty()) { return null; } return localAddresses.iterator().next(); }
/** * {@inheritDoc} */ public final void bind(SocketAddress localAddress) throws IOException { if (localAddress == null) { throw new NullPointerException("localAddress"); } List<SocketAddress> localAddresses = new ArrayList<>(1); localAddresses.add(localAddress); bind(localAddresses); }
/** * {@inheritDoc} */ @Override public final void setDefaultLocalAddresses(Iterable<? extends SocketAddress> localAddresses) { if (localAddresses == null) { throw new IllegalArgumentException("localAddresses"); } synchronized (bindLock) { synchronized (boundAddresses) { if (!boundAddresses.isEmpty()) { throw new IllegalStateException("localAddress can't be set while the acceptor is bound."); } Collection<SocketAddress> newLocalAddresses = new ArrayList<>(); for (SocketAddress a : localAddresses) { checkAddressType(a); newLocalAddresses.add(a); } if (newLocalAddresses.isEmpty()) { throw new IllegalArgumentException("empty localAddresses"); } this.defaultLocalAddresses.clear(); this.defaultLocalAddresses.addAll(newLocalAddresses); } } }
if (isDisposing()) { throw new IllegalStateException("The Accpetor disposed is being disposed."); checkAddressType(a); localAddressesCopy.add(a); if (getHandler() == null) { throw new IllegalStateException("handler is not set."); Set<SocketAddress> addresses = bindInternal(localAddressesCopy); throw e; } catch (Exception e) { throw new RuntimeIoException("Failed to bind to: " + getLocalAddresses(), e); getListeners().fireServiceActivated();
@Override public String toString() { TransportMetadata m = getTransportMetadata(); return '(' + m.getProviderName() + ' ' + m.getName() + " acceptor: " + (isActive() ? "localAddress(es): " + getLocalAddresses() + ", managedSessionCount: " + getManagedSessionCount() : "not bound") + ')'; }
unbind0(localAddressesCopy); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeIoException("Failed to unbind from: " + getLocalAddresses(), e); getListeners().fireServiceDeactivated();
/** * {@inheritDoc} */ @Override public final void unbind() { unbind(getLocalAddresses()); }
/** * {@inheritDoc} */ @Override public SocketAddress getLocalAddress() { Set<SocketAddress> localAddresses = getLocalAddresses(); if (localAddresses.isEmpty()) { return null; } return localAddresses.iterator().next(); }
/** * {@inheritDoc} */ @Override public final void bind(SocketAddress localAddress) throws IOException { if (localAddress == null) { throw new IllegalArgumentException("localAddress"); } List<SocketAddress> localAddresses = new ArrayList<>(1); localAddresses.add(localAddress); bind(localAddresses); }
/** * {@inheritDoc} */ public final void setDefaultLocalAddresses(Iterable<? extends SocketAddress> localAddresses) { if (localAddresses == null) { throw new NullPointerException("localAddresses"); } synchronized (bindLock) { if (!boundAddresses.isEmpty()) { throw new IllegalStateException( "localAddress can't be set while the acceptor is bound."); } Collection<SocketAddress> newLocalAddresses = new ArrayList<>(); for (SocketAddress a: localAddresses) { checkAddressType(a); newLocalAddresses.add(a); } if (newLocalAddresses.isEmpty()) { throw new IllegalArgumentException("empty localAddresses"); } this.defaultLocalAddresses.clear(); this.defaultLocalAddresses.addAll(newLocalAddresses); } }
if (isDisposing()) { throw new IllegalStateException("The Accpetor disposed is being disposed."); checkAddressType(a); localAddressesCopy.add(a); if (getHandler() == null) { throw new IllegalStateException("handler is not set."); Set<SocketAddress> addresses = bindInternal(localAddressesCopy); throw e; } catch (Exception e) { throw new RuntimeIoException("Failed to bind to: " + getLocalAddresses(), e); getListeners().fireServiceActivated();
@Override public String toString() { TransportMetadata m = getTransportMetadata(); return '(' + m.getProviderName() + ' ' + m.getName() + " acceptor: " + (isActive()? "localAddress(es): " + getLocalAddresses() + ", managedSessionCount: " + getManagedSessionCount() : "not bound") + ')'; }
/** * {@inheritDoc} */ @Override public final void bind() throws IOException { bind(getDefaultLocalAddresses()); }