public TCPTransportServiceComponent() {
}
protected void activate(ComponentContext ctxt) {
ConfigurationContext configContext;
TCPTransportService tcpTransport;
Properties props;
log.debug("******* TCP Transport bundle is activated ******* ");
try {
if (contextService != null) {
// Getting server's configContext instance
configContext = contextService.getServerConfigContext();
} else {
throw new Exception("ConfigurationContext is not found while loading " +
"org.wso2.carbon.transport.tcp bundle");
}
BundleContext bundleCtx = ctxt.getBundleContext();
// Save the transport configuration in the registry if not already done so
URL configURL = bundleCtx.getBundle().getResource(TCPTransportService.TRANSPORT_CONF);
new TransportPersistenceManager(configContext.getAxisConfiguration()).
saveTransportConfiguration(TCPTransportService.TRANSPORT_NAME, configURL);
TransportAxis2ConfigurationContextObserver cfgCtxObserver =
new TransportAxis2ConfigurationContextObserver(TCPTransportService.TRANSPORT_NAME,
configURL);
bundleCtx.registerService(Axis2ConfigurationContextObserver.class.getName(),
cfgCtxObserver, null);
// Instantiate TCPTransportService
tcpTransport = new TCPTransportService();
// This should ideally contain properties of TCPTransportService as a collection of
// key/value pair. Here we do not require to add any elements.
props = new Properties();