Examples of addListener()


Examples of org.boris.expr.engine.ListenerEngine.addListener()

public class ListenerEngineTest
{
    public static void main(String[] args) throws Exception {
        ListenerEngine le = new ListenerEngine(new ExcelFunctionProvider());
        le.addListener(new DebugEngineListener());
        le.set("a", "b+c");
        le.set("c", "sin(123+b)");
        le.set("b", "54.32");
        ExecutorService es = Executors.newFixedThreadPool(5);
        le.startCalculation(es, 5);
View Full Code Here

Examples of org.cipango.kaleo.event.Subscription.addListener()

        subscription = presentity.removeSubscription(session.getId());
       
        if (subscription == null)
        {
          subscription = new Subscription(presentity, session, -1, subscriberUri);
          subscription.addListener(_watcherInfo.getSubscriptionListener());
        }
        else
        {
          subscription.setExpirationTime(System.currentTimeMillis());
          if (_log.isDebugEnabled())
View Full Code Here

Examples of org.cipango.kaleo.location.Registration.addListener()

    assertEquals(aor, reginfo.getRegistrationArray(0).getAor());
    assertEquals(State.INIT, reginfo.getRegistrationArray(0).getState());
    assertEquals(0, reginfo.getRegistrationArray(0).getContactArray().length);
   
    Registration registration = new Registration(aor);
    registration.addListener(regResource)
    Binding binding1 = new Binding(new UriImpl("sip:alice@localhost"), "123@localhost", 1, now + 100000);
    registration.addBinding(binding1);
   
    //System.out.println(regResource.getState().getContent());
    assertEquals(1, reginfo.getRegistrationArray(0).getContactArray().length);
View Full Code Here

Examples of org.cipango.kaleo.presence.policy.Policy.addListener()

  protected Presentity newResource(String uri)
  {
    Presentity presentity = new Presentity(uri);
    presentity.addListener(getEventNotifier());
    Policy policy = _policyManager.getPolicy(presentity);
    policy.addListener(_policyListener);
    return presentity;
  }
 
  @Override
  protected void removeResource(Presentity presentity)
View Full Code Here

Examples of org.cipango.kaleo.presence.watcherinfo.WatcherResource.addListener()

  public void testGetState() throws Exception
  {
    Presentity presentity = new Presentity(AOR);
    WatcherResource resource = new WatcherResource(AOR, presentity);
    EventListener eventListener = new EventListener();
    resource.addListener(eventListener);
    //System.out.println(resource.getState().getContent());
    Watcherinfo watcherinfo = ((WatcherinfoDocument) resource.getState().getContent()).getWatcherinfo();
    assertEquals(State.FULL, watcherinfo.getState());
    assertEquals(1, watcherinfo.getWatcherListArray().length);
    WatcherList watcherList = watcherinfo.getWatcherListArray(0);
View Full Code Here

Examples of org.codehaus.plexus.webdav.DavServerComponent.addListener()

                }
            }

            DavServerComponent server = createServer( repo.getId(), repoDir, servletConfig );

            server.addListener( audit );
        }
    }

    public RepositoryConfiguration getRepository( DavServerRequest request )
    {
View Full Code Here

Examples of org.cometd.Client.addListener()

        if (((ChannelImpl)channel).getChannelId().isWild())
        {
            final Method m=method;
            Client wild_client=_bayeux.newClient(_name + "-wild");
            wild_client.addListener(_listener instanceof MessageListener.Asynchronous?new AsyncWildListen(wild_client,m):new SyncWildListen(wild_client,m));
            channel.subscribe(wild_client);
        }
        else
        {
            _methods.put(channelId,method);
View Full Code Here

Examples of org.cometd.bayeux.client.ClientSessionChannel.addListener()

        checkArgument(handler != null, "handler can't be null");
        ensureConnection();
        final ClientSessionChannel channel = getChannel(object);
        final MessageListenerAdapter listener = new MessageListenerAdapter(handler, channel, object);
        final ClientSessionChannel metaSubscribeChannel = session.getChannel(ClientSessionChannel.META_SUBSCRIBE);
        metaSubscribeChannel.addListener(new SubscriptionSuccessListener(new SubscriptionRecord(object, handler) , listener, metaSubscribeChannel, channel));
        channel.subscribe(listener);

        return listener.getSubscription();
    }
View Full Code Here

Examples of org.cometd.bayeux.server.ServerChannel.addListener()

        // There will be a response pending so the case is different
        publishLatch.set(new CountDownLatch(1));
        connectLatch.set(new CountDownLatch(1));
        String serviceChannelName = "/service/test";
        final ServerChannel serviceChannel = bayeux.createChannelIfAbsent(serviceChannelName, new Persistent()).getReference();
        serviceChannel.addListener(new ServerChannel.MessageListener()
        {
            public boolean onMessage(ServerSession from, ServerChannel channel, ServerMessage.Mutable message)
            {
                bayeux.getChannel(channelName).publish(emitter, data);
                return true;
View Full Code Here

Examples of org.cometd.bayeux.server.ServerSession.addListener()

        // Allow long poll to establish
        Thread.sleep(1000);

        final CountDownLatch latch = new CountDownLatch(1);
        ServerSession session = bayeux.getSession(client.getId());
        session.addListener(new ServerSession.RemoveListener()
        {
            @Override
            public void removed(ServerSession session, boolean timeout)
            {
                latch.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.