Examples of ServiceListener


Examples of com.ericdaugherty.mail.server.services.general.ServiceListener

            int executeThreads = configurationManager.getExecuteThreadCount();

            //Start the Pop3 Thread.
            port = configurationManager.getPop3Port();
            if( log.isDebugEnabled() ) log.debug( "Starting POP3 Service on port: " + port );
            popListener = new ServiceListener( port, Pop3Processor.class, executeThreads );
            new Thread( popListener, "POP3" ).start();

            //Start SMTP Threads.
            port = configurationManager.getSmtpPort();
            if( log.isDebugEnabled() ) log.debug( "Starting SMTP Service on port: " + port );
            smtpListener = new ServiceListener( port, SMTPProcessor.class, executeThreads );
            new Thread( smtpListener, "SMTP" ).start();

            //Start the SMTPSender thread (This thread actually delivers the mail recieved
            //by the SMTP threads.
            smtpSender = new SMTPSender();
View Full Code Here

Examples of com.hellblazer.slp.ServiceListener

        executor.execute(new Runnable() {
            @Override
            public void run() {
                for (ListenerRegistration reg : listeners) {
                    if (reg.query.match(reference)) {
                        final ServiceListener listener = reg.listener;
                        executor.execute(new Runnable() {
                            @Override
                            public void run() {
                                try {
                                    listener.serviceChanged(new ServiceEvent(
                                                                             type,
                                                                             reference));
                                } catch (Throwable e) {
                                    log.error(String.format("Error when notifying listener %s on reference %s type %s",
                                                            listener,
View Full Code Here

Examples of com.ibm.icu.impl.ICUService.ServiceListener

    // test notification
    // simple registration
    {
            logln("simple registration notification");
        ICULocaleService ls = new ICULocaleService();
        ServiceListener l1 = new ServiceListener() {
            private int n;
            public void serviceChanged(ICUService s) {
            logln("listener 1 report " + n++ + " service changed: " + s);
            }
        };
        ls.addListener(l1);
        ServiceListener l2 = new ServiceListener() {
            private int n;
            public void serviceChanged(ICUService s) {
            logln("listener 2 report " + n++ + " service changed: " + s);
            }
        };
        ls.addListener(l2);
        logln("registering foo... ");
        ls.registerObject("Foo", "en_FOO");
        logln("registering bar... ");
        ls.registerObject("Bar", "en_BAR");
        logln("getting foo...");
        logln((String)ls.get("en_FOO"));
        logln("removing listener 2...");
        ls.removeListener(l2);
        logln("registering baz...");
        ls.registerObject("Baz", "en_BAZ");
        logln("removing listener 1");
        ls.removeListener(l1);
        logln("registering burp...");
        ls.registerObject("Burp", "en_BURP");

        // should only get one notification even if register multiple times
        logln("... trying multiple registration");
        ls.addListener(l1);
        ls.addListener(l1);
        ls.addListener(l1);
        ls.addListener(l2);
        ls.registerObject("Foo", "en_FOO");
        logln("... registered foo");

        // since in a separate thread, we can callback and not deadlock
        ServiceListener l3 = new ServiceListener() {
            private int n;
            public void serviceChanged(ICUService s) {
            logln("listener 3 report " + n++ + " service changed...");
            if (s.get("en_BOINK") == null) { // don't recurse on ourselves!!!
                logln("registering boink...");
View Full Code Here

Examples of org.apache.activemq.util.ServiceListener

            return null;
        }

        // Ensure that the client's transport is cleaned up when no longer
        // needed.
        answer.addServiceListener(new ServiceListener() {
            public void started(Service service) {
                // Nothing to do.
            }

            public void stopped(Service service) {
View Full Code Here

Examples of org.apache.activemq.util.ServiceListener

            return null;
        }

        // Ensure that the client's transport is cleaned up when no longer
        // needed.
        answer.addServiceListener(new ServiceListener() {
            public void started(Service service) {
                // Nothing to do.
            }

            public void stopped(Service service) {
View Full Code Here

Examples of org.apache.activemq.util.ServiceListener

            return null;
        }

        // Ensure that the client's transport is cleaned up when no longer
        // needed.
        answer.addServiceListener(new ServiceListener() {
            public void started(Service service) {
                // Nothing to do.
            }

            public void stopped(Service service) {
View Full Code Here

Examples of org.jboss.gravia.runtime.ServiceListener

    }

    private void assertDisableComponent(final ModuleContext ctxA, ServiceA srvA) throws InterruptedException {

        final CountDownLatch latch = new CountDownLatch(1);
        ServiceListener listener = new ServiceListener() {
            @Override
            public void serviceChanged(ServiceEvent event) {
                int type = event.getType();
                ServiceReference<?> sref = event.getServiceReference();
                List<String> clazzes = Arrays.asList(((String[]) sref.getProperty(Constants.OBJECTCLASS)));
View Full Code Here

Examples of org.jboss.gravia.runtime.ServiceListener

    }

    private void assertDisableComponent(final ModuleContext ctxA, ServiceA srvA) throws InterruptedException {

        final CountDownLatch latch = new CountDownLatch(1);
        ServiceListener listener = new ServiceListener() {
            @Override
            public void serviceChanged(ServiceEvent event) {
                int type = event.getType();
                ServiceReference<?> sref = event.getServiceReference();
                List<String> clazzes = Arrays.asList(((String[]) sref.getProperty(Constants.OBJECTCLASS)));
View Full Code Here

Examples of org.jboss.gravia.runtime.ServiceListener

    @Override
    public void start(final ModuleContext context) throws Exception {

        // Add a listener that tracks {@link Resolver} and {@link Repository}
        ServiceListener listener = new ServiceListener() {

            @Override
            @SuppressWarnings("unchecked")
            public void serviceChanged(ServiceEvent event) {
                if (event.getType() == ServiceEvent.REGISTERED) {
View Full Code Here

Examples of org.jboss.msc.service.ServiceListener

        if (bindingService == null) {
            ROOT_LOGGER.debugf("Cannot unbind %s since no binding exists with that name", name);
            return;
        }
        final CountDownLatch removedLatch = new CountDownLatch(1);
        final ServiceListener listener = new AbstractServiceListener() {
            @Override
            public void transition(ServiceController controller, Transition transition) {
                if (transition.getAfter() == ServiceController.Substate.REMOVED) {
                    removedLatch.countDown();
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.