ParameterConnection(Channel channel, final Map<String, ?> environment, final JMXServiceURL serviceUrl) { super(channel, environment); this.channel = channel; this.environment = environment; this.clientRequestManager = new ClientRequestManager(); this.clientExecutorManager = new ClientExecutorManager(environment); this.serviceUrl = serviceUrl; this.handlerRegistry = createHandlerRegistry(); }
ServerProxy(final Channel channel, final WrappedMBeanServerConnection server, final Executor executor, final ServerMessageInterceptor serverMessageInterceptor) { super(channel, executor, serverMessageInterceptor); this.channel = channel; this.server = server; handlerRegistry = createHandlerRegistry(); this.remoteNotificationManager = new RemoteNotificationManager(); this.executor = executor; }
public void handleError(Channel channel, IOException error) { getClientRequestManager().cancelAllRequests(error); }
void start() { mbeanServerConnection = new TheConnection(); localNotificationManager = new LocalNotificationManager(); channel.receiveMessage(new MessageReceiver()); }
public static VersionedConnection getConnection(final Channel channel, final Map<String, ?> environment, final JMXServiceURL serviceURL) throws IOException { ParameterConnection parameterConnection = new ParameterConnection(channel, environment, serviceURL); return parameterConnection.getConnection(); }
public static void startServer(final Channel channel, final MBeanServerManager mbeanServerManager, final Executor executor, final ServerMessageInterceptor serverMessageInterceptor) throws IOException { ParameterProxy proxy = new ParameterProxy(channel, mbeanServerManager, executor, serverMessageInterceptor); proxy.start(); }
public static IoFuture<Void> awaitWelcomeMessage(final Channel channel) { VersionedIoFuture<Void> future = new VersionedIoFuture<Void>(); channel.receiveMessage(new WelcomeMessageReceiver(future)); return future; }
protected void writeResponse(final String response, final byte inResponseTo, final int correlationId) throws IOException { write(new MessageWriter() { @Override public void write(DataOutput output) throws IOException { output.writeByte(inResponseTo ^ RESPONSE_MASK); output.writeInt(correlationId); output.writeByte(SUCCESS); output.writeByte(STRING); output.writeUTF(response); } }); }
private void writeResponse(final Integer response, final byte inResponseTo, final int correlationId) throws IOException { write(new MessageWriter() { @Override public void write(DataOutput output) throws IOException { output.writeByte(inResponseTo ^ RESPONSE_MASK); output.writeInt(correlationId); output.writeByte(SUCCESS); output.writeByte(INTEGER); output.writeInt(response); } }); }
public void removeNotificationListener(ObjectName name, NotificationListener listener) throws InstanceNotFoundException, ListenerNotFoundException, IOException { removeNotificationListener(localNotificationManager.matchToRemove(name, listener)); }
ClientConnection(final Channel channel, final Map<String, ?> environment, final ClientRequestManager clientRequestManager, final ClientExecutorManager clientExecutorManager, final String connectionId) { super(channel, environment); this.channel = channel; this.clientRequestManager = clientRequestManager; this.clientExecutorManager = clientExecutorManager; this.connectionId = connectionId; handlerRegistry = createHandlerRegistry(); }
private void sendVersionHeader() throws IOException { write(new MessageWriter() { @Override public void write(DataOutput output) throws IOException { output.writeBytes("JMX"); output.writeByte(VersionTwo.getVersionIdentifier()); } }); }
ParameterProxy(Channel channel, MBeanServerManager mbeanServerManager, Executor executor, ServerMessageInterceptor serverMessageInterceptor) { super(channel, executor, serverMessageInterceptor); this.channel = channel; this.executor = executor; this.mbeanServerManager = mbeanServerManager; registry = createHandlerRegistry(); this.serverMessageInterceptor = serverMessageInterceptor; }
public void handleError(Channel channel, IOException e) { future.setException(e); }
/** * Creates and returns a {@link org.jboss.marshalling.Unmarshaller} which is ready to be used for unmarshalling. The * {@link org.jboss.marshalling.Unmarshaller#start(org.jboss.marshalling.ByteInput)} will be invoked by this method, to use * the passed {@link java.io.DataInput dataInput}, before returning the unmarshaller. * * This unmarshaller will use the context class loader to resolve any classes. * * @param dataInput The data input from which to unmarshall * @return * @throws IOException */ protected Unmarshaller prepareForUnMarshalling(final DataInput dataInput) throws IOException { return prepareForUnMarshalling(dataInput, DefaultClassResolver.INSTANCE); }
@Override public void handleEnd(Channel channel) { end(); }
protected void writeResponse(final byte inResponseTo, final int correlationId) throws IOException { write(new MessageWriter() { @Override public void write(DataOutput output) throws IOException { output.writeByte(inResponseTo ^ RESPONSE_MASK); output.writeInt(correlationId); output.writeByte(SUCCESS); } }); }
private void writeResponse(final boolean response, final byte inResponseTo, final int correlationId) throws IOException { write(new MessageWriter() { @Override public void write(DataOutput output) throws IOException { output.writeByte(inResponseTo ^ RESPONSE_MASK); output.writeInt(correlationId); output.writeByte(SUCCESS); output.writeByte(BOOLEAN); output.writeBoolean(response); } }); }
public void removeNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException, ListenerNotFoundException, IOException { removeNotificationListener(localNotificationManager.matchToRemove(name, listener, filter, handback)); }
protected void writeResponse(final Exception e, final byte inResponseTo, final int correlationId) throws IOException { write(new MessageWriter() { @Override public void write(DataOutput output) throws IOException { output.writeByte(inResponseTo ^ RESPONSE_MASK); output.writeInt(correlationId); output.writeByte(FAILURE); output.writeByte(EXCEPTION); Marshaller marshaller = prepareForMarshalling(output); marshaller.writeObject(e); marshaller.finish(); } }); }