use of nl.nn.adapterframework.configuration.IbisContext in project iaf by ibissource.
the class BatchTransformerPipeBase method configure.
public void configure() throws ConfigurationException {
super.configure();
IbisContext ibisContext = getAdapter().getConfiguration().getIbisManager().getIbisContext();
querySender = (FixedQuerySender) ibisContext.createBeanAutowireByName(FixedQuerySender.class);
querySender.setName("source of " + getName());
querySender.configure();
}
use of nl.nn.adapterframework.configuration.IbisContext in project iaf by ibissource.
the class Result2LobWriterBase method configure.
public void configure() throws ConfigurationException {
super.configure();
IbisContext ibisContext = getPipe().getAdapter().getConfiguration().getIbisManager().getIbisContext();
querySender = (FixedQuerySender) ibisContext.createBeanAutowireByName(FixedQuerySender.class);
querySender.setName("querySender of " + getName());
querySender.configure();
}
use of nl.nn.adapterframework.configuration.IbisContext in project iaf by ibissource.
the class ActionBase method initAction.
/**
* Initializes the fields in the <code>Action</code> for this specific
* application. Most important: it retrieves the Configuration object
* from the servletContext.
* @see nl.nn.adapterframework.configuration.Configuration
*/
public void initAction(HttpServletRequest request) {
locale = getLocale(request);
messageResources = getResources(request);
errors = new ActionErrors();
session = request.getSession();
String attributeKey = AppConstants.getInstance().getProperty(ConfigurationServlet.KEY_CONTEXT);
IbisContext ibisContext = (IbisContext) getServlet().getServletContext().getAttribute(attributeKey);
ibisManager = null;
if (ibisContext != null) {
ibisManager = ibisContext.getIbisManager();
}
if (ibisManager == null) {
log.warn("Could not retrieve ibisManager from context");
} else {
log.debug("retrieved ibisManager [" + ClassUtils.nameOf(ibisManager) + "][" + ibisManager + "] from servlet context attribute [" + attributeKey + "]");
}
}
use of nl.nn.adapterframework.configuration.IbisContext in project iaf by ibissource.
the class CreateRestViewPipe method retrieveParameters.
private Map retrieveParameters(HttpServletRequest httpServletRequest, ServletContext servletContext, String srcPrefix) throws DomBuilderException {
String attributeKey = AppConstants.getInstance().getProperty(ConfigurationServlet.KEY_CONTEXT);
IbisContext ibisContext = (IbisContext) servletContext.getAttribute(attributeKey);
Map parameters = new Hashtable();
String requestInfoXml = "<requestInfo>" + "<servletRequest>" + "<serverInfo><![CDATA[" + servletContext.getServerInfo() + "]]></serverInfo>" + "<serverName>" + httpServletRequest.getServerName() + "</serverName>" + "</servletRequest>" + "</requestInfo>";
parameters.put("requestInfo", XmlUtils.buildNode(requestInfoXml));
parameters.put("upTime", XmlUtils.buildNode("<upTime>" + ibisContext.getUptime() + "</upTime>"));
String machineNameXml = "<machineName>" + Misc.getHostname() + "</machineName>";
parameters.put("machineName", XmlUtils.buildNode(machineNameXml));
String fileSystemXml = "<fileSystem>" + "<totalSpace>" + Misc.getFileSystemTotalSpace() + "</totalSpace>" + "<freeSpace>" + Misc.getFileSystemFreeSpace() + "</freeSpace>" + "</fileSystem>";
parameters.put("fileSystem", XmlUtils.buildNode(fileSystemXml));
String applicationConstantsXml = appConstants.toXml(true);
parameters.put("applicationConstants", XmlUtils.buildNode(applicationConstantsXml));
String processMetricsXml = ProcessMetrics.toXml();
parameters.put("processMetrics", XmlUtils.buildNode(processMetricsXml));
parameters.put("menuBar", XmlUtils.buildNode(retrieveMenuBarParameter(srcPrefix)));
parameters.put(SRCPREFIX, srcPrefix);
return parameters;
}
use of nl.nn.adapterframework.configuration.IbisContext in project iaf by ibissource.
the class RestListenerUtils method retrieveIbisManager.
public static IbisManager retrieveIbisManager(IPipeLineSession session) {
ServletContext servletContext = (ServletContext) session.get(IPipeLineSession.SERVLET_CONTEXT_KEY);
if (servletContext != null) {
String attributeKey = AppConstants.getInstance().getProperty(ConfigurationServlet.KEY_CONTEXT);
IbisContext ibisContext = (IbisContext) servletContext.getAttribute(attributeKey);
if (ibisContext != null) {
return ibisContext.getIbisManager();
}
}
return null;
}
Aggregations