Package org.wso2.carbon.core.transports

Examples of org.wso2.carbon.core.transports.TransportPersistenceManager


            BundleContext bundleCtx = ctxt.getBundleContext();

            // Save the transport configuration in the registry if not already done so
            URL configURL = bundleCtx.getBundle().getResource(
                    UDPTransportService.TRANSPORT_CONF);
            new TransportPersistenceManager(configContext.getAxisConfiguration()).
                    saveTransportConfiguration(UDPTransportService.TRANSPORT_NAME,
                                               configURL);
            TransportAxis2ConfigurationContextObserver cfgCtxObserver =
                    new TransportAxis2ConfigurationContextObserver(UDPTransportService.TRANSPORT_NAME,
                                                                   configURL);
View Full Code Here


            // Enabling http binding generation
            Parameter enableHttp = new Parameter("enableHTTP", "true");
            AxisConfiguration axisConfig = serverConfigContext.getAxisConfiguration();
            axisConfig.addParameter(enableHttp);

            new TransportPersistenceManager(axisConfig).
                    updateEnabledTransports(axisConfig.getTransportsIn().values(),
                            axisConfig.getTransportsOut().values());

            runInitializers();
View Full Code Here

        List<TransportInDescription> transportIns = new ArrayList<TransportInDescription>();
        List<TransportOutDescription> transportOuts = new ArrayList<TransportOutDescription>();

        // process transport senders
        TransportPersistenceManager transportPM = new TransportPersistenceManager(axisConfig);
        String[] transports = transportPM.getEnabledTransports(false);
        if (transports != null) {
            for (String transportToInit : transports) {
                if (axisConfig.getTransportOut(transportToInit.trim()) == null) {
                    TransportOutDescription transportOutDesc =
                            transportPM.getTransportSender(transportToInit, true);
                    if (transportOutDesc != null) {
                        transportOuts.add(transportOutDesc);
                        // No need to init the sender
                        // ConfigurationContextFactory should take care of that
                    }
                }
            }
        }

        // process transport receivers
        transports = transportPM.getEnabledTransports(true);
        if (transports != null) {
            for (String transportToInit : transports) {
                if (axisConfig.getTransportIn(transportToInit.trim()) == null) {
                    TransportInDescription transportInDesc =
                            transportPM.getTransportListener(transportToInit, true);
                    if (transportInDesc != null) {
                        transportIns.add(transportInDesc);
                        // No need to init the listener
                        // ListenerManager should take care of that
                    }
                }
            }
        }

        // Now add the descriptions to the axis configuration
        // This ensures that either all the transports in the registry are initialized or none at all
        for (TransportOutDescription trpOut : transportOuts) {
            axisConfig.addTransportOut(trpOut);
            if (log.isDebugEnabled()) {
                log.debug(trpOut.getName() + " transport sender added to the configuration");
            }
        }

        for (TransportInDescription trpIn : transportIns) {
            axisConfig.addTransportIn(trpIn);
            if (log.isDebugEnabled()) {
                log.debug(trpIn.getName() + " transport receiver added to the configuration");
            }
        }

        // Save the transport configurations to the registry.
        // We do this here to ensure that necessary transport resources are in the registry
        // before services start getting deployed.
        transportPM.updateEnabledTransports(axisConfig.getTransportsIn().values(),
                                            axisConfig.getTransportsOut().values());
    }
View Full Code Here

                // add transport associations
                if (!axisService.isEnableAllTransports()) {
                    List<String> exposedTransports = axisService.getExposedTransports();
                    for (String exposedTransport : exposedTransports) {
                        Resource transportResource =
                                new TransportPersistenceManager(axisConfig).
                                        getTransportResource(exposedTransport);
                        if (transportResource == null) {
                            throw new CarbonException("The configuration resource " +
                                    "for " + exposedTransport + " transport does not exist");
                        }
View Full Code Here

                }
                // Adding the transports to the configRegistry
                while (transportItr.hasNext()) {
                    String transport = transportItr.next();
                    Resource transportResource =
                            new TransportPersistenceManager(axisConfig).
                                    getTransportResource(transport);
                    if (transportResource == null) {
                        throw new CarbonException("The configuration resource for " + transport +
                            " transport does not exist");
                    }
View Full Code Here

                handleException("No service found for the provided service name : " + serviceName);
                return;
            }
            Resource serviceResource = getService(axisService);
            Resource transportResource =
                    new TransportPersistenceManager(axisConfig).
                            getTransportResource(transportProtocol);

            configRegistry.beginTransaction();

            if (transportResource != null) {
                configRegistry.removeAssociation(serviceResource.getPath(),
                        transportResource.getPath(),
                        RegistryResources.Associations.EXPOSED_TRANSPORTS);
                transportResource.discard();
            }

            List<String> exposedTrps = axisService.getExposedTransports();
            for (String transport : exposedTrps) {
                transportResource =
                        new TransportPersistenceManager(axisConfig).getTransportResource(transport);
                if (transportResource == null) {
                    throw new CarbonException("The configuration resource for " + transport +
                            " transport does not exist");
                }
                configRegistry.addAssociation(serviceResource.getPath(), transportResource
View Full Code Here

            // Set the work directory
            tenantConfigCtx.setProperty(ServerConstants.WORK_DIR,
                                        mainConfigCtx.getProperty(ServerConstants.WORK_DIR));
            SuperTenantCarbonContext.getCurrentContext(tenantConfigCtx).setTenantId(tenantId);
            new TransportPersistenceManager(tenantAxisConfig).
                    updateEnabledTransports(tenantAxisConfig.getTransportsIn().values(),
                                            tenantAxisConfig.getTransportsOut().values());

            CarbonContextHolder.getThreadLocalCarbonContextHolder().setTenantId(tenantId);
            // Notify all observers
View Full Code Here

        }

        public void run() {
            try {
                MessageContext msgCtx = ((Axis2MessageContext) synCtx).getAxis2MessageContext();
                Event<MessageContext> event = new Event(msgCtx);
                subscriptions = subscriptionManager.getMatchingSubscriptions(event);
            } catch (EventException e) {
                handleException("Matching subscriptions fetching error", e);
            }
View Full Code Here

     * @throws EventException event
     */
    private void processGetStatusRequest(MessageContext mc,
                                         ResponseMessageBuilder messageBuilder)
            throws AxisFault, EventException {
        Subscription subscription =
                SubscriptionMessageBuilder.createGetStatusMessage(mc);
        if (log.isDebugEnabled()) {
            log.debug("GetStatus request recived for SynapseSubscription ID : " +
                    subscription.getId());
        }
        subscription = subscriptionManager.getSubscription(subscription.getId());
        if (subscription != null) {
            if (log.isDebugEnabled()) {
                log.debug("Sending GetStatus responce for SynapseSubscription ID : " +
                        subscription.getId());
            }
            //send the responce
            SOAPEnvelope soapEnvelope = messageBuilder.genGetStatusResponse(subscription);
            dispatchResponse(soapEnvelope, EventingConstants.WSE_GET_STATUS_RESPONSE,
                    mc, false);
View Full Code Here


    public SynapseSubscription() {
        this.setId(UIDGenerator.generateURNString());
        this.setDeliveryMode(EventingConstants.WSE_DEFAULT_DELIVERY_MODE);
        SubscriptionData subscriptionData = new SubscriptionData();
        subscriptionData.setProperty(SynapseEventingConstants.STATIC_ENTRY, "false");
        this.setSubscriptionData(subscriptionData);
    }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.core.transports.TransportPersistenceManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.