Examples of EventContext


Examples of javax.naming.event.EventContext

      env.setProperty("java.naming.factory.url.pkgs", "org.jnp.interfaces");
      InitialContext ic = new InitialContext(env);
      log.info("Created InitialContext");
      Context ctx = (Context) ic.lookup("");
      assertTrue("Context is an EventContext", ctx instanceof EventContext);
      EventContext ectx = (EventContext) ctx;
      ectx.addNamingListener("", EventContext.ONELEVEL_SCOPE, listener);
      log.info("Added NamingListener");
      ctx.bind("testAddObject", "testAddObject.bind");
      assertTrue("Saw bind event", listener.waitOnEvent());
      NamingEvent event = listener.getEvent(0);
      assertEquals("OBJECT_ADDED", NamingEvent.OBJECT_ADDED, event.getType());
View Full Code Here

Examples of net.hasor.core.EventContext

public class EventLinkTest {
    @Test
    public void syncEventTest() throws IOException, URISyntaxException, InterruptedException {
        System.out.println("--->>syncEventTest<<--");
        AppContext appContext = Hasor.createAppContext();
        EventContext ec = appContext.getEnvironment().getEventContext();
        //
        final String EventName = "MyEvent";//事件链的终端
        final String SeedEvent = "SeedEvent";//种子事件
        //1.添加事件监听器F
        ec.addListener(EventName, new MyListener());
        ec.addListener(SeedEvent, new EventListener() {
            public void onEvent(String event, Object[] params) throws Throwable {
                AppContext app = (AppContext) params[0];
                EventContext localEC = app.getEnvironment().getEventContext();
                System.out.println("before MyEvent.");
                localEC.fireAsyncEvent(EventName, 1);
                localEC.fireAsyncEvent(EventName, 2);
            }
        });
        //2.引发种子事件
        ec.fireAsyncEvent(SeedEvent, appContext);
        //3.由于是同步事件,因此下面这条日志会在事件处理完毕之后喷出
View Full Code Here

Examples of org.apache.ode.bpel.evt.EventContext

     * Populate BpelEventContext, to be used by Registered Event Listeners
     * @param event ScopeEvent
     */
    protected void fillEventContext(ScopeEvent event)
    {
        EventContext eventContext = new EventContextImpl(_scopeFrame.oscope,
                                                            _scopeFrame.scopeInstanceId,
                                                            getBpelRuntimeContext());
        event.eventContext = eventContext;
    }
View Full Code Here

Examples of org.apache.tapestry.EventContext

        {
            public Boolean answer() throws Throwable
            {
                Object[] arguments = EasyMock.getCurrentArguments();

                EventContext ec = (EventContext) arguments[1];

                assertEquals(ec.getCount(), context.length);

                for (int i = 0; i < context.length; i++)
                {
                    assertEquals(ec.get(Object.class, i), context[i]);
                }


                return handled;
            }
View Full Code Here

Examples of org.apache.tapestry5.EventContext

        final Class<?> pageClass = value.getPageClass();
        final Object[] activationContext = value.getPageActivationContext();

        final String pageName = this.resolver.resolvePageClassNameToPageName(pageClass.getName());

        final EventContext context = activationContext == null ? new EmptyEventContext()
                : new ArrayEventContext(this.typeCoercer, activationContext);
       
        Object generatingRederedPage = request.getAttribute(InternalConstants.GENERATING_RENDERED_PAGE);

        try
View Full Code Here

Examples of org.apache.tapestry5.EventContext

        appendContext(true, parameters.getEventContext(), builder);

        Link result = new LinkImpl(builder.toString(), baseURL == null, forForm, response,
                optimizer);

        EventContext pageActivationContext = parameters.getPageActivationContext();

        if (pageActivationContext.getCount() != 0)
        {
            // Reuse the builder
            builder.setLength(0);
            appendContext(true, pageActivationContext, builder);
View Full Code Here

Examples of org.apache.tapestry5.EventContext

        if (!componentClassResolver.isPageName(activePageName))
            return null;

        activePageName = componentClassResolver.canonicalizePageName(activePageName);

        EventContext eventContext = contextPathEncoder.decodePath(matcher.group(CONTEXT));

        EventContext activationContext = contextPathEncoder.decodePath(request
                .getParameter(InternalConstants.PAGE_CONTEXT_NAME));

        // The event type is often omitted, and defaults to "action".

        if (eventType == null)
View Full Code Here

Examples of org.apache.tapestry5.EventContext

            String pageActivationContext)
    {
        if (!componentClassResolver.isPageName(pageName))
            return null;

        EventContext activationContext = contextPathEncoder.decodePath(pageActivationContext);

        String canonicalized = componentClassResolver.canonicalizePageName(pageName);

        boolean loopback = request.getParameter(TapestryConstants.PAGE_LOOPBACK_PARAMETER_NAME) != null;
View Full Code Here

Examples of org.apache.tapestry5.EventContext

    @Test
    public void matches_on_event_type()
    {
        ComponentEventCallback handler = mockComponentEventHandler();
        EventContext context = mockEventContext();

        train_getCount(context, 0);

        replay();
View Full Code Here

Examples of org.apache.tapestry5.EventContext

    @Test
    public void event_type_match_is_case_insensitive()
    {
        ComponentEventCallback handler = mockComponentEventHandler();
        EventContext context = mockEventContext();

        train_getCount(context, 0);

        replay();
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.