public <S extends SocketAddress> S getPeerAddress(final Class<S> type) { return delegate.getPeerAddress(type); }
public SocketAddress getPeerAddress() { return delegate.getPeerAddress(); }
/** * Get the peer address of this connection, cast to a specific type, if any. If there is an address but it * cannot be cast to the given type, {@code null} is returned. * * @param type the address type class * @param <S> the address type * @return the peer address of this connection, or {@code null} if there is no peer address or the address is * of the wrong type */ default <S extends SocketAddress> S getPeerAddress(Class<S> type) { final SocketAddress peerAddress = getPeerAddress(); return type.isInstance(peerAddress) ? type.cast(peerAddress) : null; }
public SocketAddress getPeerAddress() { return channel.getConnection().getPeerAddress(); }
void addAddress(EJBClientChannel clientChannel) { synchronized (this) { addressesByConnection.put(clientChannel, (InetSocketAddress) clientChannel.getChannel().getConnection().getPeerAddress()); serviceURLCache = null; } }
attachments.put(EJBClient.SOURCE_ADDRESS_KEY, channel.getConnection().getPeerAddress());
public SocketAddress getPeerAddress() { return delegate.getPeerAddress(); }
public <S extends SocketAddress> S getPeerAddress(final Class<S> type) { return delegate.getPeerAddress(type); }
/** * Get the peer address of this connection, cast to a specific type, if any. If there is an address but it * cannot be cast to the given type, {@code null} is returned. * * @param type the address type class * @param <S> the address type * @return the peer address of this connection, or {@code null} if there is no peer address or the address is * of the wrong type */ default <S extends SocketAddress> S getPeerAddress(Class<S> type) { final SocketAddress peerAddress = getPeerAddress(); return type.isInstance(peerAddress) ? type.cast(peerAddress) : null; }
public SocketAddress getPeerAddress() { return channel.getConnection().getPeerAddress(); }
public SocketAddress getPeerAddress() { return channel.getConnection().getPeerAddress(); }
void addAddress(EJBClientChannel clientChannel) { synchronized (this) { addressesByConnection.put(clientChannel, (InetSocketAddress) clientChannel.getChannel().getConnection().getPeerAddress()); serviceURLCache = null; } }
void addAddress(EJBClientChannel clientChannel) { synchronized (this) { addressesByConnection.put(clientChannel, (InetSocketAddress) clientChannel.getChannel().getConnection().getPeerAddress()); serviceURLCache = null; } }
/** * Get the remote address. * * @return the remote address, {@code null} if not available */ public InetAddress getRemoteAddress() { final Channel channel; try { channel = strategy.getChannel(); } catch (IOException e) { return null; } final Connection connection = channel.getConnection(); final InetSocketAddress peerAddress = connection.getPeerAddress(InetSocketAddress.class); return peerAddress == null ? null : peerAddress.getAddress(); }
/** * Get the remote address. * * @return the remote address, {@code null} if not available */ public InetAddress getRemoteAddress() { final Channel channel; try { channel = strategy.getChannel(); } catch (IOException e) { return null; } final Connection connection = channel.getConnection(); final InetSocketAddress peerAddress = connection.getPeerAddress(InetSocketAddress.class); return peerAddress == null ? null : peerAddress.getAddress(); }
@Override public void handleEvent(final Event event) throws IOException { final SecurityIdentity localIdentity = channel.getConnection().getLocalIdentity(); InetSocketAddress peerSocketAddress = channel.getConnection().getPeerAddress(InetSocketAddress.class); final InetAddress remoteAddress = peerSocketAddress != null ? peerSocketAddress.getAddress() : null; try { AccessAuditContext.doAs(localIdentity, remoteAddress, new PrivilegedExceptionAction<Void>() { @Override public Void run() throws IOException { SecurityActions.currentAccessAuditContext().setAccessMechanism(AccessMechanism.JMX); event.run(); return null; } }); } catch (PrivilegedActionException e) { Exception cause = e.getException(); if (cause instanceof IOException) { throw (IOException) cause; } else { throw new IOException(cause); } } }
@Override public void handleRequest(final DataInput input, final ActiveOperation.ResultHandler<ModelNode> resultHandler, final ManagementRequestContext<Void> context) throws IOException { ControllerLogger.MGMT_OP_LOGGER.tracef("Handling ExecuteRequest for %d", context.getOperationId()); InetSocketAddress peerSocketAddress = channelAssociation.getChannel().getConnection().getPeerAddress(InetSocketAddress.class); final InetAddress remoteAddress = peerSocketAddress != null ? peerSocketAddress.getAddress() : null; final ModelNode operation = new ModelNode(); ProtocolUtils.expectHeader(input, ModelControllerProtocol.PARAM_OPERATION); operation.readExternal(input); ProtocolUtils.expectHeader(input, ModelControllerProtocol.PARAM_INPUTSTREAMS_LENGTH); final int attachmentsLength = input.readInt(); context.executeAsync(new ManagementRequestContext.AsyncTask<Void>() { @Override public void execute(final ManagementRequestContext<Void> context) throws Exception { final ManagementResponseHeader response = ManagementResponseHeader.create(context.getRequestHeader()); try { AccessAuditContext.doAs(connectionIdentity, remoteAddress, new PrivilegedExceptionAction<Void>() { @Override public Void run() throws Exception { final CompletedCallback callback = new CompletedCallback(response, context, resultHandler); doExecute(operation, attachmentsLength, context, callback); return null; } }); } catch (PrivilegedActionException e) { throw e.getException(); } } }, clientRequestExecutor); }
@Override public void handleRequest(final DataInput input, final ActiveOperation.ResultHandler<ModelNode> resultHandler, final ManagementRequestContext<Void> context) throws IOException { ControllerLogger.MGMT_OP_LOGGER.tracef("Handling ExecuteRequest for %d", context.getOperationId()); InetSocketAddress peerSocketAddress = channelAssociation.getChannel().getConnection().getPeerAddress(InetSocketAddress.class); final InetAddress remoteAddress = peerSocketAddress != null ? peerSocketAddress.getAddress() : null; final ModelNode operation = new ModelNode(); ProtocolUtils.expectHeader(input, ModelControllerProtocol.PARAM_OPERATION); operation.readExternal(input); ProtocolUtils.expectHeader(input, ModelControllerProtocol.PARAM_INPUTSTREAMS_LENGTH); final int attachmentsLength = input.readInt(); context.executeAsync(new ManagementRequestContext.AsyncTask<Void>() { @Override public void execute(final ManagementRequestContext<Void> context) throws Exception { final ManagementResponseHeader response = ManagementResponseHeader.create(context.getRequestHeader()); try { AccessAuditContext.doAs(connectionIdentity, remoteAddress, new PrivilegedExceptionAction<Void>() { @Override public Void run() throws Exception { final CompletedCallback callback = new CompletedCallback(response, context, resultHandler); doExecute(operation, attachmentsLength, context, callback); return null; } }); } catch (PrivilegedActionException e) { throw e.getException(); } } }, clientRequestExecutor); }
attachments.put(EJBClient.SOURCE_ADDRESS_KEY, channel.getConnection().getPeerAddress());
attachments.put(EJBClient.SOURCE_ADDRESS_KEY, channel.getConnection().getPeerAddress());