public TransportListener getTransportListener() { return trpInDesc.getReceiver(); }
public TransportListener getTransportListener() { return trpInDesc.getReceiver(); }
public TransportListener getTransportListener() { return trpInDesc.getReceiver(); }
private AxisServletListener getAxisServletListener(String name) { TransportInDescription desc = axisConfiguration.getTransportIn(name); if (desc == null) { return null; } TransportListener receiver = desc.getReceiver(); if (receiver instanceof AxisServletListener) { return (AxisServletListener)receiver; } else { return null; } }
private AxisServletListener getAxisServletListener(String name) { TransportInDescription desc = axisConfiguration.getTransportIn(name); if (desc == null) { return null; } TransportListener receiver = desc.getReceiver(); if (receiver instanceof AxisServletListener) { return (AxisServletListener)receiver; } else { return null; } }
public int getActiveConnectionsCount() { Map<String, TransportInDescription> trpIns = configurationContext.getAxisConfiguration().getTransportsIn(); for (TransportInDescription trpIn : trpIns.values()) { if (trpIn.getReceiver() instanceof HttpCoreNIOListener) { return ((HttpCoreNIOListener) trpIn.getReceiver()).getActiveConnectionsSize(); } } return 0; }
public int getActiveConnectionsCount() { Map<String, TransportInDescription> trpIns = configurationContext.getAxisConfiguration().getTransportsIn(); for (TransportInDescription trpIn : trpIns.values()) { if (trpIn.getReceiver() instanceof HttpCoreNIOListener) { return ((HttpCoreNIOListener) trpIn.getReceiver()).getActiveConnectionsSize(); } } return 0; }
/** * Add an incoming transport description (i.e. receiver) to our configuration. * * @param transport TransportInDescription to add. * @throws AxisFault */ public void addTransportIn(TransportInDescription transport) throws AxisFault { if (transport.getReceiver() == null) { throw new AxisFault( "Transport Receiver can not be null for the transport " + transport.getName()); } transportsIn.put(transport.getName(), transport); }
/** * Add an incoming transport description (i.e. receiver) to our configuration. * * @param transport TransportInDescription to add. * @throws AxisFault */ public void addTransportIn(TransportInDescription transport) throws AxisFault { if (transport.getReceiver() == null) { throw new AxisFault( "Transport Receiver can not be null for the transport " + transport.getName()); } transportsIn.put(transport.getName(), transport); }
/** * Determines the total number of pending listener threads (active + queued). * * @return the total number of pending listener threads (active + queued). */ public int getPendingListenerThreadCount() { int pendingThreads = 0; Map<String, TransportInDescription> trpIns = configurationContext.getAxisConfiguration().getTransportsIn(); for (TransportInDescription trpIn : trpIns.values()) { TransportListener trpLst = trpIn.getReceiver(); if (trpLst instanceof ManagementSupport) { int inUse = ((ManagementSupport) trpLst).getActiveThreadCount(); int inQue = ((ManagementSupport) trpLst).getQueueSize(); if ((inUse + inQue) > 0) { if (log.isDebugEnabled()) { log.debug(new StringBuilder("Transport Listener : ") .append(trpIn.getName()).append(" currently using : ") .append(inUse).append(" threads with ").append(inQue) .append(" requests already queued...").toString()); } pendingThreads = (inUse + inQue); } } } return pendingThreads; }
/** * Determines the total number of pending listener threads (active + queued). * * @return the total number of pending listener threads (active + queued). */ public int getPendingListenerThreadCount() { int pendingThreads = 0; Map<String, TransportInDescription> trpIns = configurationContext.getAxisConfiguration().getTransportsIn(); for (TransportInDescription trpIn : trpIns.values()) { TransportListener trpLst = trpIn.getReceiver(); if (trpLst instanceof ManagementSupport) { int inUse = ((ManagementSupport) trpLst).getActiveThreadCount(); int inQue = ((ManagementSupport) trpLst).getQueueSize(); if ((inUse + inQue) > 0) { if (log.isDebugEnabled()) { log.debug(new StringBuilder("Transport Listener : ") .append(trpIn.getName()).append(" currently using : ") .append(inUse).append(" threads with ").append(inQue) .append(" requests already queued...").toString()); } pendingThreads = (inUse + inQue); } } } return pendingThreads; }
private String getWsdlInformation(String serviceName, AxisConfiguration axisConfig) throws AxisFault { String ip; try { ip = NetworkUtils.getLocalHostname(); } catch (SocketException e) { throw new AxisFault("Cannot get local host name", e); } TransportInDescription http = axisConfig.getTransportIn("http"); if (http != null) { EndpointReference epr = ((HttpTransportListener) http.getReceiver()). getEPRForService(serviceName, ip); String wsdlUrlPrefix = epr.getAddress(); if (wsdlUrlPrefix.endsWith("/")) { wsdlUrlPrefix = wsdlUrlPrefix.substring(0, wsdlUrlPrefix.length() - 1); } return wsdlUrlPrefix + "?wsdl"; } return null; }
/** * Pauses all Axis2 listeners which support this operation. */ public void pauseListeners() { if ((configurationContext != null) && (configurationContext.getAxisConfiguration() != null)) { Map<String, TransportInDescription> trpIns = configurationContext.getAxisConfiguration().getTransportsIn(); for (TransportInDescription trpIn : trpIns.values()) { TransportListener trpLst = trpIn.getReceiver(); if (trpLst instanceof ManagementSupport) { try { ((ManagementSupport) trpLst).pause(); } catch (AxisFault axisFault) { log.error(new StringBuilder("Error putting transport listener for: ") .append(trpIn.getName()).append(" into maintenence").toString()); } } } } }
/** * Resumes all paused Axis2 listeners. */ public void resumeListeners() { if ((configurationContext != null) && (configurationContext.getAxisConfiguration() != null)) { Map<String, TransportInDescription> trpIns = configurationContext.getAxisConfiguration().getTransportsIn(); for (TransportInDescription trpIn : trpIns.values()) { TransportListener trpLst = trpIn.getReceiver(); if (trpLst instanceof ManagementSupport) { try { ((ManagementSupport) trpLst).resume(); } catch (AxisFault axisFault) { log.error(new StringBuilder("Error resuming transport listener for: ") .append(trpIn.getName()).append(" from maintenence").toString()); } } } } }
public String getEPR(AxisService service) throws AxisFault { EndpointReference[] endpointReferences = trpInDesc.getReceiver().getEPRsForService(service.getName(), "localhost"); return endpointReferences != null && endpointReferences.length > 0 ? endpointReferences[0].getAddress() : null; } }
public String getEPR(AxisService service) throws AxisFault { EndpointReference[] endpointReferences = trpInDesc.getReceiver().getEPRsForService(service.getName(), "localhost"); return endpointReferences != null && endpointReferences.length > 0 ? endpointReferences[0].getAddress() : null; } }
public String getEPR(AxisService service) throws AxisFault { EndpointReference[] endpointReferences = trpInDesc.getReceiver().getEPRsForService(service.getName(), "localhost"); return endpointReferences != null && endpointReferences.length > 0 ? endpointReferences[0].getAddress() : null; } }
public void destroy() throws AxisFault { stop(); this.configctx.setTransportManager(null); // need to destory all the transports not only the started ones // most of the transports create the worker pool at the init method. TransportInDescription transportInDescription; for (Object o : configctx.getAxisConfiguration().getAxisConfiguration().getTransportsIn().values()) { transportInDescription = (TransportInDescription) o; TransportListener transportListener = transportInDescription.getReceiver(); transportListener.destroy(); } this.startedTransports.clear(); this.configctx = null; }
public void destroy() throws AxisFault { stop(); this.configctx.setTransportManager(null); // need to destory all the transports not only the started ones // most of the transports create the worker pool at the init method. TransportInDescription transportInDescription; for (Object o : configctx.getAxisConfiguration().getAxisConfiguration().getTransportsIn().values()) { transportInDescription = (TransportInDescription) o; TransportListener transportListener = transportInDescription.getReceiver(); transportListener.destroy(); } this.startedTransports.clear(); this.configctx = null; }
/** * Initialize the transport description for Axis * * @param transprtInDesc * the transport description * * @throws AxisFault */ public void initTransportListenerForAxis(TransportInDescription transprtInDesc) throws AxisFault { // These values are defined by the component and not by the Axis2 // configuration file so we set them if Axis2 do something with them... Parameter portParam = transprtInDesc.getParameter(PARAM_PORT); if (portParam == null) { int port = getPortForTransport(transprtInDesc.getName()); portParam = new Parameter(PARAM_PORT, Integer.toString(port)); } transprtInDesc.addParameter(portParam); Parameter hostParam = transprtInDesc.getParameter(HOST_ADDRESS); if (hostParam == null) { hostParam = new Parameter(HOST_ADDRESS, this.getHostAddress()); } transprtInDesc.addParameter(hostParam); ((SOAPTransportListener) transprtInDesc.getReceiver()).setServerConfig(this); }