Examples of onEvent()


Examples of org.apache.tuscany.core.context.scope.SessionScopeContext.onEvent()

        // end request
        ctx.clearIdentifier(HttpSessionEvent.HTTP_IDENTIFIER);

        // expire session
        scope.onEvent(new HttpSessionEnd(this, session));
        Assert.assertEquals(0, one.getNumberInstantiated());
        scope.stop();
    }

    JavaContextFactoryBuilder builder;
View Full Code Here

Examples of org.apache.tuscany.core.context.scope.SessionScopeContext.onEvent()

        SessionScopeContext scope = new SessionScopeContext(ctx);
        scope.registerFactories(MockContextFactory.createWiredContexts(Scope.SESSION,scope));
        scope.start();
        Object session =  new Object();
        ctx.setIdentifier(HttpSessionEvent.HTTP_IDENTIFIER,session);
        scope.onEvent(new HttpSessionBound(this,session));
        OrderedDependentPojo source = (OrderedDependentPojo) scope.getContext("source").getInstance(null);
        assertNotNull(source.getPojo());
        // expire module
        assertEquals(2,source.getNumberInstantiated());
        scope.onEvent(new HttpSessionEnd(this,session));
View Full Code Here

Examples of org.apache.tuscany.core.context.scope.SessionScopeContext.onEvent()

        scope.onEvent(new HttpSessionBound(this,session));
        OrderedDependentPojo source = (OrderedDependentPojo) scope.getContext("source").getInstance(null);
        assertNotNull(source.getPojo());
        // expire module
        assertEquals(2,source.getNumberInstantiated());
        scope.onEvent(new HttpSessionEnd(this,session));
        assertEquals(0,source.getNumberInstantiated());
        scope.stop();
    }

View Full Code Here

Examples of org.apache.tuscany.sca.event.RuntimeEventListener.onEvent()

    EventPublisher publisher;

    public void testFireListener() {
        Event event = new TestEvent();
        RuntimeEventListener listener = EasyMock.createMock(RuntimeEventListener.class);
        listener.onEvent(EasyMock.same(event));
        EasyMock.expectLastCall();
        EasyMock.replay(listener);
        publisher.addListener(listener);
        publisher.publish(event);
        EasyMock.verify(listener);
View Full Code Here

Examples of org.apache.tuscany.spi.component.CompositeComponent.onEvent()

        listener.onEvent(eq(event));
        expectLastCall();
        replay(listener);
        composite.addListener(listener);
        composite.start();
        composite.onEvent(event);
    }

    public void testPrepare() {
        CompositeComponent composite = new CompositeComponentImpl("parent", null, null, null);
        composite.prepare();
View Full Code Here

Examples of org.apache.tuscany.spi.component.ScopeContainer.onEvent()

        ScopeContainer scope = new ModuleScopeContainer(null);
        scope.start();

        Map<String, AtomicComponent> contexts = MockFactory.createWiredComponents("source", SourceImpl.class,
            scope, members, "target", Target.class, TargetImpl.class, scope);
        scope.onEvent(new CompositeStart(this, null));
        AtomicComponent sourceComponent = contexts.get("source");
        AtomicComponent targetComponent = contexts.get("target");
        Source source = (Source) sourceComponent.getServiceInstance();
        Target target = (Target) targetComponent.getServiceInstance();
        assertNull(source.getTarget().getString());
View Full Code Here

Examples of org.apache.tuscany.spi.event.RuntimeEventListener.onEvent()

    public void testFireListener() {
        SCAObject object = new TestSCAObject("foo", null);
        Event event = new TestEvent();
        RuntimeEventListener listener = EasyMock.createMock(RuntimeEventListener.class);
        listener.onEvent(EasyMock.same(event));
        EasyMock.expectLastCall();
        EasyMock.replay(listener);
        object.addListener(listener);
        object.publish(event);
    }
View Full Code Here

Examples of org.apache.wicket.event.IEventSink.onEvent()

    boolean targetsCycle = targetsSession || sink instanceof RequestCycle;
    boolean targetsComponent = sink instanceof Component;

    if (!targetsComponent && !targetsCycle)
    {
      sink.onEvent(event);
      return;
    }

    if (targetsApplication)
    {
View Full Code Here

Examples of org.glassfish.jersey.server.internal.monitoring.CompositeApplicationEventListener.onEvent()

            }
            final List<ApplicationEventListener> appEventListeners = locator.getAllServices(ApplicationEventListener.class);
            if (!appEventListeners.isEmpty()) {
                compositeListener = new CompositeApplicationEventListener(
                        appEventListeners);
                compositeListener.onEvent(new ApplicationEventImpl(ApplicationEvent.Type.INITIALIZATION_START,
                        this.runtimeConfig, componentBag.getRegistrations(), resourceBag.classes, resourceBag.instances,
                        null));
            }

            processingProviders = getProcessingProviders(componentBag);
View Full Code Here

Examples of org.glassfish.jersey.server.monitoring.RequestEventListener.onEvent()

    }

    private void execute() {
        listener.onEvent(appEvent);
        RequestEventListener requestListener = listener.onRequest(requestStartEvent);
        requestListener.onEvent(requestMethodStartEvent);
        requestListener.onEvent(requestMethodFinishEvent);
    }

    private void executeWithException() {
        listener.onEvent(appEvent);
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.