use of nl.nn.adapterframework.core.IAdapter in project iaf by ibissource.
the class DefaultIbisManager method startAdapters.
private void startAdapters(Configuration configuration) {
log.info("Starting all autostart-configured adapters for configuation " + configuration.getName());
for (IAdapter adapter : configuration.getAdapterService().getAdapters().values()) {
if (adapter.isAutoStart()) {
log.info("Starting adapter [" + adapter.getName() + "]");
adapter.startRunning();
}
}
}
use of nl.nn.adapterframework.core.IAdapter in project iaf by ibissource.
the class DefaultIbisManager method unload.
private void unload(Configuration configuration) {
configuration.setUnloadInProgressOrDone(true);
while (configuration.getStartAdapterThreads().size() > 0) {
log.debug("Waiting for start threads to end: " + configuration.getStartAdapterThreads());
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
log.warn("Interrupted waiting for start threads to end", e);
}
}
stopAdapters(configuration);
while (configuration.getStopAdapterThreads().size() > 0) {
log.debug("Waiting for stop threads to end: " + configuration.getStopAdapterThreads());
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
log.warn("Interrupted waiting for stop threads to end", e);
}
}
// destroy all jmsContainers
for (int i = 0; i < configuration.getRegisteredAdapters().size(); i++) {
IAdapter adapter = configuration.getRegisteredAdapter(i);
Iterator recIt = adapter.getReceiverIterator();
if (recIt.hasNext()) {
while (recIt.hasNext()) {
IReceiver receiver = (IReceiver) recIt.next();
if (receiver instanceof ReceiverBase) {
ReceiverBase rb = (ReceiverBase) receiver;
IListener listener = rb.getListener();
if (listener instanceof PushingJmsListener) {
PushingJmsListener pjl = (PushingJmsListener) listener;
pjl.destroy();
}
}
}
}
}
while (configuration.getRegisteredAdapters().size() > 0) {
IAdapter adapter = configuration.getRegisteredAdapter(0);
AdapterService adapterService = configuration.getAdapterService();
adapterService.unRegisterAdapter(adapter);
}
configurations.remove(configuration);
}
use of nl.nn.adapterframework.core.IAdapter in project iaf by ibissource.
the class DefaultIbisManager method stopAdapters.
private void stopAdapters(Configuration configuration) {
configuration.dumpStatistics(HasStatistics.STATISTICS_ACTION_MARK_FULL);
log.info("Stopping all adapters for configuation " + configuration.getName());
List<IAdapter> adapters = new ArrayList<IAdapter>(configuration.getAdapterService().getAdapters().values());
Collections.reverse(adapters);
for (IAdapter adapter : adapters) {
log.info("Stopping adapter [" + adapter.getName() + "]");
adapter.stopRunning();
}
}
use of nl.nn.adapterframework.core.IAdapter in project iaf by ibissource.
the class IbisSoapServlet method listWsdls.
protected void listWsdls(HttpServletRequest req, Writer w) throws IOException {
w.write("<h2>Available WSDL's:</h2>");
w.write("<ol>");
int count = 0;
for (IAdapter a : ibisManager.getRegisteredAdapters()) {
count++;
w.write("<li>");
try {
Adapter adapter = (Adapter) a;
Wsdl wsdl = new Wsdl(adapter.getPipeLine());
setDocumentation(wsdl, req);
String url = req.getContextPath() + req.getServletPath() + "/" + wsdl.getName() + getWsdlExtention();
w.write("<a href='" + url + "'>" + wsdl.getName() + "</a>");
String useIncludes = req.getContextPath() + req.getServletPath() + "/" + wsdl.getName() + getWsdlExtention() + "?useIncludes=true";
w.write(" (<a href='" + useIncludes + "'>using includes</a>");
String zip = req.getContextPath() + req.getServletPath() + "/" + wsdl.getName() + ".zip";
w.write(" <a href='" + zip + "'>zip</a>)");
} catch (Exception e) {
w.write(a.getName() + ": ");
if (e.getMessage() != null) {
w.write(e.getMessage());
} else {
w.write(e.toString());
}
}
w.write("</li>");
}
w.write("</ol>");
if (count == 0) {
w.write("No registered listeners found");
}
}
use of nl.nn.adapterframework.core.IAdapter in project iaf by ibissource.
the class IbisSoapServlet method listRestServices.
protected void listRestServices(HttpServletRequest req, Writer w) throws IOException {
w.write("<h2>Available REST services:</h2>");
w.write("<ol>");
int count = 0;
for (IAdapter a : ibisManager.getRegisteredAdapters()) {
Adapter adapter = (Adapter) a;
Iterator recIt = adapter.getReceiverIterator();
while (recIt.hasNext()) {
IReceiver receiver = (IReceiver) recIt.next();
if (receiver instanceof ReceiverBase) {
ReceiverBase rb = (ReceiverBase) receiver;
IListener listener = rb.getListener();
if (listener instanceof RestListener) {
RestListener rl = (RestListener) listener;
if (rl.isView()) {
count++;
w.write("<li>");
w.write("<a href=../" + rl.getRestUriPattern() + ">" + rb.getName() + "</a>");
w.write("</li>");
}
}
}
}
}
w.write("</ol>");
if (count == 0) {
w.write("No rest listeners found");
}
}
Aggregations