use of org.jboss.as.test.integration.ejb.mdb.dynamic.api.TelnetListener in project wildfly by wildfly.
the class TelnetResourceAdapter method endpointActivation.
@Override
public void endpointActivation(MessageEndpointFactory messageEndpointFactory, ActivationSpec activationSpec) throws ResourceException {
final TelnetActivationSpec telnetActivationSpec = (TelnetActivationSpec) activationSpec;
final MessageEndpoint messageEndpoint = messageEndpointFactory.createEndpoint(null);
// This messageEndpoint instance is also castable to the ejbClass of the MDB
final TelnetListener telnetListener = (TelnetListener) messageEndpoint;
try {
final TelnetServer telnetServer = new TelnetServer(telnetActivationSpec, telnetListener, port);
workManager.scheduleWork(new Work() {
@Override
public void release() {
}
@Override
public void run() {
try {
telnetServer.activate();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}, 0, null, null);
activated.put(port, telnetServer);
} catch (IOException e) {
throw new ResourceException(e);
}
}
Aggregations