org.apache.axis2.engine.ListenerManager Java Examples

The following examples show how to use org.apache.axis2.engine.ListenerManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SampleAxis2Server.java    From micro-integrator with Apache License 2.0 6 votes vote down vote up
public void start() throws IOException {
    log.info("Starting sample Axis2 server");
    //To set the socket can be bound even though a previous connection is still in a timeout state.
    if (System.getProperty(CoreConnectionPNames.SO_REUSEADDR) == null) {
        System.setProperty(CoreConnectionPNames.SO_REUSEADDR, "true");
    }
    listenerManager = new ListenerManager();
    listenerManager.init(cfgCtx);
    listenerManager.start();
    try {
        Thread.sleep(2000);
    } catch (InterruptedException ignored) {

    }
    started = true;
}
 
Example #2
Source File: SampleAxis2Server.java    From product-ei with Apache License 2.0 6 votes vote down vote up
public void start() throws IOException {
    log.info("Starting sample Axis2 server");
    //To set the socket can be bound even though a previous connection is still in a timeout state.
    if (System.getProperty(CoreConnectionPNames.SO_REUSEADDR) == null) {
        System.setProperty(CoreConnectionPNames.SO_REUSEADDR, "true");
    }
    listenerManager = new ListenerManager();
    listenerManager.init(cfgCtx);
    listenerManager.start();
    try {
        Thread.sleep(2000);
    } catch (InterruptedException ignored) {

    }
    started = true;
}
 
Example #3
Source File: Axis2ServerManager.java    From micro-integrator with Apache License 2.0 5 votes vote down vote up
public void start() throws IOException {
    log.info("Starting sample Axis2 server");
    listenerManager = new ListenerManager();
    listenerManager.init(cfgCtx);
    listenerManager.start();
    try {
        Thread.sleep(2000);
    } catch (InterruptedException ignored) {
    }
    started = true;
}
 
Example #4
Source File: Axis2ServerManager.java    From product-ei with Apache License 2.0 5 votes vote down vote up
public void start() throws IOException {
    log.info("Starting sample Axis2 server");
    listenerManager = new ListenerManager();
    listenerManager.init(cfgCtx);
    listenerManager.start();
    try {
        Thread.sleep(2000);
    } catch (InterruptedException ignored) {
    }
    started = true;
}
 
Example #5
Source File: TasksDSComponent.java    From carbon-commons with Apache License 2.0 5 votes vote down vote up
@Reference(
        name = "listener.manager.service",
        service = org.apache.axis2.engine.ListenerManager.class,
        cardinality = ReferenceCardinality.MANDATORY,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unsetListenerManager")
protected void setListenerManager(ListenerManager lm) {
    /* we don't really need this, the listener manager service is acquired
     * to make sure, as a workaround, that the task component is initialized
     * after the axis2 clustering agent is initialized */
}
 
Example #6
Source File: DiscoveryComponent.java    From carbon-commons with Apache License 2.0 5 votes vote down vote up
@Reference(
        name = "listener.manager.service",
        service = org.apache.axis2.engine.ListenerManager.class,
        cardinality = ReferenceCardinality.MANDATORY,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unsetListenerManager")
protected void setListenerManager(ListenerManager lm) {

    if (log.isDebugEnabled()) {
        log.debug("Listener manager bound to the discovery component");
    }
}
 
Example #7
Source File: SampleAxis2ServerManager.java    From micro-integrator with Apache License 2.0 4 votes vote down vote up
public void start(String[] args) throws Exception {
    String repoLocation = null;
    String confLocation = null;

    CommandLineOptionParser optionsParser = new CommandLineOptionParser(args);
    List invalidOptionsList = optionsParser.getInvalidOptions(new OptionsValidator() {
        public boolean isInvalid(CommandLineOption option) {
            String optionType = option.getOptionType();
            return !("repo".equalsIgnoreCase(optionType) || "conf"
                .equalsIgnoreCase(optionType));
        }
    });

    if ((invalidOptionsList.size() > 0) || (args.length > 4)) {
        printUsage();
    }

    Map optionsMap = optionsParser.getAllOptions();

    CommandLineOption repoOption = (CommandLineOption) optionsMap
        .get("repo");
    CommandLineOption confOption = (CommandLineOption) optionsMap
        .get("conf");

    log.info("[SimpleAxisServer] Starting");
    if (repoOption != null) {
        repoLocation = repoOption.getOptionValue();
        System.out.println("[SimpleAxisServer] Using the Axis2 Repository : "
            + new File(repoLocation).getAbsolutePath());
    }
    if (confOption != null) {
        confLocation = confOption.getOptionValue();
        System.out
            .println("[SimpleAxisServer] Using the Axis2 Configuration File : "
                + new File(confLocation).getAbsolutePath());
    }
    try {
        configctx = ConfigurationContextFactory
            .createConfigurationContextFromFileSystem(repoLocation,
                confLocation);

        configurePort(configctx);

        // Need to initialize the cluster manager at last since we are changing the servers
        // HTTP/S ports above. In the axis2.xml file, we need to set the "AvoidInitiation" param
        // to "true"
        ClusteringAgent clusteringAgent =
                configctx.getAxisConfiguration().getClusteringAgent();
        if(clusteringAgent != null) {
            clusteringAgent.setConfigurationContext(configctx);
            clusteringAgent.init();
        }

        // Finally start the transport listeners
        listenerManager = new ListenerManager();
        listenerManager.init(configctx);
        listenerManager.start();
        log.info("[SimpleAxisServer] Started");
    } catch (Throwable t) {
        log.fatal("[SimpleAxisServer] Shutting down. Error starting SimpleAxisServer", t);
        System.exit(1); // must stop application
    }
}
 
Example #8
Source File: SampleAxis2ServerManager.java    From micro-integrator with Apache License 2.0 4 votes vote down vote up
public void start(String[] args) throws Exception {
    String repoLocation = null;
    String confLocation = null;

    CommandLineOptionParser optionsParser = new CommandLineOptionParser(args);
    List invalidOptionsList = optionsParser.getInvalidOptions(new OptionsValidator() {
        public boolean isInvalid(CommandLineOption option) {
            String optionType = option.getOptionType();
            return !("repo".equalsIgnoreCase(optionType) || "conf"
                .equalsIgnoreCase(optionType));
        }
    });

    if ((invalidOptionsList.size() > 0) || (args.length > 4)) {
        printUsage();
    }

    Map optionsMap = optionsParser.getAllOptions();

    CommandLineOption repoOption = (CommandLineOption) optionsMap
        .get("repo");
    CommandLineOption confOption = (CommandLineOption) optionsMap
        .get("conf");

    log.info("[SimpleAxisServer] Starting");
    if (repoOption != null) {
        repoLocation = repoOption.getOptionValue();
        System.out.println("[SimpleAxisServer] Using the Axis2 Repository : "
            + new File(repoLocation).getAbsolutePath());
    }
    if (confOption != null) {
        confLocation = confOption.getOptionValue();
        System.out
            .println("[SimpleAxisServer] Using the Axis2 Configuration File : "
                + new File(confLocation).getAbsolutePath());
    }
    try {
        configctx = ConfigurationContextFactory
            .createConfigurationContextFromFileSystem(repoLocation,
                confLocation);

        configurePort(configctx);

        // Need to initialize the cluster manager at last since we are changing the servers
        // HTTP/S ports above. In the axis2.xml file, we need to set the "AvoidInitiation" param
        // to "true"
        ClusteringAgent clusteringAgent =
                configctx.getAxisConfiguration().getClusteringAgent();
        if(clusteringAgent != null) {
            clusteringAgent.setConfigurationContext(configctx);
            clusteringAgent.init();
        }

        // Finally start the transport listeners
        listenerManager = new ListenerManager();
        listenerManager.init(configctx);
        listenerManager.start();
        log.info("[SimpleAxisServer] Started");
    } catch (Throwable t) {
        log.fatal("[SimpleAxisServer] Shutting down. Error starting SimpleAxisServer", t);
        System.exit(1); // must stop application
    }
}
 
Example #9
Source File: SampleAxis2ServerManager.java    From product-ei with Apache License 2.0 4 votes vote down vote up
public void start(String[] args) throws Exception {
    String repoLocation = null;
    String confLocation = null;

    CommandLineOptionParser optionsParser = new CommandLineOptionParser(args);
    List invalidOptionsList = optionsParser.getInvalidOptions(new OptionsValidator() {
        public boolean isInvalid(CommandLineOption option) {
            String optionType = option.getOptionType();
            return !("repo".equalsIgnoreCase(optionType) || "conf"
                .equalsIgnoreCase(optionType));
        }
    });

    if ((invalidOptionsList.size() > 0) || (args.length > 4)) {
        printUsage();
    }

    Map optionsMap = optionsParser.getAllOptions();

    CommandLineOption repoOption = (CommandLineOption) optionsMap
        .get("repo");
    CommandLineOption confOption = (CommandLineOption) optionsMap
        .get("conf");

    log.info("[SimpleAxisServer] Starting");
    if (repoOption != null) {
        repoLocation = repoOption.getOptionValue();
        System.out.println("[SimpleAxisServer] Using the Axis2 Repository : "
            + new File(repoLocation).getAbsolutePath());
    }
    if (confOption != null) {
        confLocation = confOption.getOptionValue();
        System.out
            .println("[SimpleAxisServer] Using the Axis2 Configuration File : "
                + new File(confLocation).getAbsolutePath());
    }
    try {
        configctx = ConfigurationContextFactory
            .createConfigurationContextFromFileSystem(repoLocation,
                confLocation);

        configurePort(configctx);

        // Need to initialize the cluster manager at last since we are changing the servers
        // HTTP/S ports above. In the axis2.xml file, we need to set the "AvoidInitiation" param
        // to "true"
        ClusteringAgent clusteringAgent =
                configctx.getAxisConfiguration().getClusteringAgent();
        if(clusteringAgent != null) {
            clusteringAgent.setConfigurationContext(configctx);
            clusteringAgent.init();
        }

        // Finally start the transport listeners
        listenerManager = new ListenerManager();
        listenerManager.init(configctx);
        listenerManager.start();
        log.info("[SimpleAxisServer] Started");
    } catch (Throwable t) {
        log.fatal("[SimpleAxisServer] Shutting down. Error starting SimpleAxisServer", t);
        System.exit(1); // must stop application
    }
}
 
Example #10
Source File: SampleAxis2ServerManager.java    From product-ei with Apache License 2.0 4 votes vote down vote up
public void start(String[] args) throws Exception {
    String repoLocation = null;
    String confLocation = null;

    CommandLineOptionParser optionsParser = new CommandLineOptionParser(args);
    List invalidOptionsList = optionsParser.getInvalidOptions(new OptionsValidator() {
        public boolean isInvalid(CommandLineOption option) {
            String optionType = option.getOptionType();
            return !("repo".equalsIgnoreCase(optionType) || "conf"
                .equalsIgnoreCase(optionType));
        }
    });

    if ((invalidOptionsList.size() > 0) || (args.length > 4)) {
        printUsage();
    }

    Map optionsMap = optionsParser.getAllOptions();

    CommandLineOption repoOption = (CommandLineOption) optionsMap
        .get("repo");
    CommandLineOption confOption = (CommandLineOption) optionsMap
        .get("conf");

    log.info("[SimpleAxisServer] Starting");
    if (repoOption != null) {
        repoLocation = repoOption.getOptionValue();
        System.out.println("[SimpleAxisServer] Using the Axis2 Repository : "
            + new File(repoLocation).getAbsolutePath());
    }
    if (confOption != null) {
        confLocation = confOption.getOptionValue();
        System.out
            .println("[SimpleAxisServer] Using the Axis2 Configuration File : "
                + new File(confLocation).getAbsolutePath());
    }
    try {
        configctx = ConfigurationContextFactory
            .createConfigurationContextFromFileSystem(repoLocation,
                confLocation);

        configurePort(configctx);

        // Finally start the transport listeners
        listenerManager = new ListenerManager();
        listenerManager.init(configctx);
        listenerManager.start();
        log.info("[SimpleAxisServer] Started");
    } catch (Throwable t) {
        log.fatal("[SimpleAxisServer] Shutting down. Error starting SimpleAxisServer", t);
        System.exit(1); // must stop application
    }
}
 
Example #11
Source File: APIManagerComponent.java    From carbon-apimgt with Apache License 2.0 4 votes vote down vote up
protected void unsetListenerManager(ListenerManager listenerManager) {
    log.debug("Listener manager unbound from the API manager component");
}
 
Example #12
Source File: TasksDSComponent.java    From carbon-commons with Apache License 2.0 4 votes vote down vote up
protected void unsetListenerManager(ListenerManager lm) {
    /* empty */
}
 
Example #13
Source File: DiscoveryComponent.java    From carbon-commons with Apache License 2.0 4 votes vote down vote up
protected void unsetListenerManager(ListenerManager lm) {

        if (log.isDebugEnabled()) {
            log.debug("Listener manager unbound from the discovery component");
        }
    }