@Override public String toString() { final E obj = get(); return obj != null ? "{" + obj + "}" : null; }
@Override @SuppressWarnings("unchecked") protected void resetProperties() { localSocketAddressHolder = Holder.lazyHolder( new NullaryFunction<SocketAddress>() { @Override public SocketAddress evaluate() { return ((ServerSocketChannel) channel).socket().getLocalSocketAddress(); } }); peerSocketAddressHolder = Holder.staticHolder(null); }
protected ReadResult(final Connection<L> connection, final K message, final L srcAddress, final int readSize) { this.connection = connection; this.message = message; this.srcAddressHolder = Holder.staticHolder(srcAddress); this.readSize = readSize; }
protected ReadResult(final Connection<L> connection, final K message, final L srcAddress, final int readSize) { this.connection = connection; this.message = message; this.srcAddressHolder = Holder.staticHolder(srcAddress); this.readSize = readSize; }
/** * Returns the address of the endpoint this <tt>Connection</tt> is * connected to, or <tt>null</tt> if it is unconnected. * @return the address of the endpoint this <tt>Connection</tt> is * connected to, or <tt>null</tt> if it is unconnected. */ @Override public SocketAddress getPeerAddress() { return peerSocketAddressHolder.get(); }
@Override @SuppressWarnings("unchecked") protected void resetProperties() { localSocketAddressHolder = Holder.lazyHolder( new NullaryFunction<SocketAddress>() { @Override public SocketAddress evaluate() { return ((ServerSocketChannel) channel).socket().getLocalSocketAddress(); } }); peerSocketAddressHolder = Holder.staticHolder(null); }
/** * Set address, associated with the current {@link org.glassfish.grizzly.IOEvent} processing. * When we process {@link org.glassfish.grizzly.IOEvent#READ} event - it represents sender address, * or when process {@link org.glassfish.grizzly.IOEvent#WRITE} - address of receiver. * * @param address address, associated with the current {@link org.glassfish.grizzly.IOEvent} processing. */ public void setAddress(final Object address) { addressHolder = Holder.staticHolder(address); }
/** * Returns the address of the endpoint this <tt>Connection</tt> is * connected to, or <tt>null</tt> if it is unconnected. * @return the address of the endpoint this <tt>Connection</tt> is * connected to, or <tt>null</tt> if it is unconnected. */ @Override public SocketAddress getPeerAddress() { return peerSocketAddressHolder.get(); }
@Override @SuppressWarnings("unchecked") protected void resetProperties() { localSocketAddressHolder = Holder.lazyHolder( new NullaryFunction<SocketAddress>() { @Override public SocketAddress evaluate() { return ((ServerSocketChannel) channel).socket().getLocalSocketAddress(); } }); peerSocketAddressHolder = Holder.staticHolder(null); }
/** * Create an address holder. * * @param dstAddress * @return */ protected Holder<L> createAddrHolder(final L dstAddress) { return Holder.staticHolder(dstAddress); }
/** * Returns the local address of this <tt>Connection</tt>, * or <tt>null</tt> if it is unconnected. * @return the local address of this <tt>Connection</tt>, * or <tt>null</tt> if it is unconnected. */ @Override public SocketAddress getLocalAddress() { return localSocketAddressHolder.get(); }
@Override @SuppressWarnings("unchecked") protected void resetProperties() { localSocketAddressHolder = Holder.lazyHolder( new NullaryFunction<SocketAddress>() { @Override public SocketAddress evaluate() { return ((ServerSocketChannel) channel).socket().getLocalSocketAddress(); } }); peerSocketAddressHolder = Holder.staticHolder(null); }
/** * Set address, associated with the current {@link org.glassfish.grizzly.IOEvent} processing. * When we process {@link org.glassfish.grizzly.IOEvent#READ} event - it represents sender address, * or when process {@link org.glassfish.grizzly.IOEvent#WRITE} - address of receiver. * * @param address address, associated with the current {@link org.glassfish.grizzly.IOEvent} processing. */ public void setAddress(final Object address) { addressHolder = Holder.staticHolder(address); }
/** * Get address, associated with the current {@link org.glassfish.grizzly.IOEvent} processing. * When we process {@link org.glassfish.grizzly.IOEvent#READ} event - it represents sender address, * or when process {@link org.glassfish.grizzly.IOEvent#WRITE} - address of receiver. * * @return address, associated with the current {@link org.glassfish.grizzly.IOEvent} processing. */ public Object getAddress() { return addressHolder != null ? addressHolder.get() : null; }
@Override @SuppressWarnings("unchecked") protected void resetProperties() { localSocketAddressHolder = Holder.lazyHolder( new NullaryFunction<SocketAddress>() { @Override public SocketAddress evaluate() { return ((ServerSocketChannel) channel).socket().getLocalSocketAddress(); } }); peerSocketAddressHolder = Holder.staticHolder(null); }
/** * Create an address holder. * * @param dstAddress * @return */ protected Holder<L> createAddrHolder(final L dstAddress) { return Holder.staticHolder(dstAddress); }
@Override public String toString() { final E obj = get(); return obj != null ? "{" + obj + "}" : null; }
@Override @SuppressWarnings("unchecked") protected void resetProperties() { localSocketAddressHolder = Holder.lazyHolder( new NullaryFunction<SocketAddress>() { @Override public SocketAddress evaluate() { return ((ServerSocketChannel) channel).socket().getLocalSocketAddress(); } }); peerSocketAddressHolder = Holder.staticHolder(null); }
protected ReadResult(final Connection<L> connection, final K message, final L srcAddress, final int readSize) { this.connection = connection; this.message = message; this.srcAddressHolder = Holder.staticHolder(srcAddress); this.readSize = readSize; }
/** * Returns the address of the endpoint this <tt>Connection</tt> is * connected to, or <tt>null</tt> if it is unconnected. * @return the address of the endpoint this <tt>Connection</tt> is * connected to, or <tt>null</tt> if it is unconnected. */ @Override public SocketAddress getPeerAddress() { return peerSocketAddressHolder.get(); }