Examples of EventHook


Examples of org.jruby.runtime.EventHook

        hookedRuntime1 = Ruby.newInstance(tracedConfig);
        hookedRuntime1.evalScriptlet(BOOT_SCRIPT);
        hookedRuntime2 = Ruby.newInstance(tracedConfig);
        hookedRuntime2.evalScriptlet(BOOT_SCRIPT);

        hookedRuntime1.addEventHook(new EventHook() {
            @Override
            public void eventHandler(ThreadContext context, String eventName, String file, int line, String name, IRubyObject type) {
                // do nothing
            }

            @Override
            public boolean isInterestedInEvent(RubyEvent event) {
                // want everything
                return true;
            }
        });

        hookedRuntime2.addEventHook(new EventHook() {
            @Override
            public void eventHandler(ThreadContext context, String eventName, String file, int line, String name, IRubyObject type) {
                // get binding
                Binding binding = context.currentBinding();
            }
View Full Code Here

Examples of org.jruby.runtime.EventHook

        } else {
            _eventSet = EnumSet.allOf(RubyEvent.class);
        }
       
        final EnumSet<RubyEvent> eventSet = _eventSet;
        hook = new EventHook() {
            @Override
            public synchronized void eventHandler(ThreadContext context, String eventName, String file, int line, String name, IRubyObject type) {
                if (!enabled || context.isWithinTrace()) return;
               
                inside = true;
View Full Code Here

Examples of org.osgi.framework.hooks.bundle.EventHook

        /* set tracked with the initial bundles */
        tracked.setInitial(bundles);
      }
    }
    tracked.trackInitial();
    EventHook hook = new BundleEventHook(tracked);
    sr = context.registerService(EventHook.class.getName(), hook, null);
  }
View Full Code Here

Examples of org.osgi.framework.hooks.bundle.EventHook

            if (tracked != null) {
                return;
            }
            t = new Tracked();
            synchronized (t) {
                EventHook hook = new BundleEventHook(t);
                sr = context.registerService(EventHook.class.getName(), hook, null);
                Bundle[] bundles = context.getBundles();
                if (bundles != null) {
                    int length = bundles.length;
                    for (int i = 0; i < length; i++) {
View Full Code Here

Examples of org.osgi.framework.hooks.service.EventHook

        final Bundle b2 = getMockBundle();
        final Bundle b3 = getMockBundle();
        final Bundle b4 = getMockBundle();

        final Set calledHooks = new HashSet();
        final EventHook eh1 = new EventHook()
        {
            public void event(ServiceEvent event, Collection contexts)
            {
                calledHooks.add(this);
            }
        };
        final EventHook eh2 = new EventHook()
        {
            public void event(ServiceEvent event, Collection contexts)
            {
                calledHooks.add(this);
                for (Iterator it = contexts.iterator(); it.hasNext();)
View Full Code Here

Examples of org.osgi.framework.hooks.service.EventHook

        BundleContext c = (BundleContext) controlContext.getMock();
        controlContext.expectAndReturn(c.getBundle(), b);
        controlContext.replay();

        ServiceRegistry sr = new ServiceRegistry(new Logger(), null);
        EventHook hook = new EventHook()
        {
            public void event(ServiceEvent event, Collection contexts)
            {
            }
        };
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.