Package org.cometd.annotation

Examples of org.cometd.annotation.ServerAnnotationProcessor.process()


        // Configure services
        // Guice does not handle @PostConstruct and @PreDestroy, so we need to handle them
        ServerAnnotationProcessor processor = new ServerAnnotationProcessor(bayeuxServer);
        GuiceBayeuxService service = injector.getInstance(GuiceBayeuxService.class);
        Assert.assertTrue(processor.process(service));

        // At this point we're configured properly
        // The code above should be put into a ServletContextListener.contextInitialized()
        // method, so that it is triggered by the web application lifecycle handling
        // and the BayeuxServer instance can be put into the ServletContext
View Full Code Here


        // Allow anybody to handshake
        bayeux.getChannel(ServerChannel.META_HANDSHAKE).addAuthorizer(GrantAuthorizer.GRANT_PUBLISH);

        ServerAnnotationProcessor processor = new ServerAnnotationProcessor(bayeux);
        processor.process(new EchoRPC());
        processor.process(new Monitor());
        // processor.process(new ChatService());

        bayeux.createChannelIfAbsent("/foo/bar/baz", new ConfigurableServerChannel.Initializer.Persistent());
View Full Code Here

        // Allow anybody to handshake
        bayeux.getChannel(ServerChannel.META_HANDSHAKE).addAuthorizer(GrantAuthorizer.GRANT_PUBLISH);

        ServerAnnotationProcessor processor = new ServerAnnotationProcessor(bayeux);
        processor.process(new EchoRPC());
        processor.process(new Monitor());
        // processor.process(new ChatService());

        bayeux.createChannelIfAbsent("/foo/bar/baz", new ConfigurableServerChannel.Initializer.Persistent());

        if (logger.isDebugEnabled())
View Full Code Here

    @Test
    public void testRemoteCallWithResult() throws Exception
    {
        ServerAnnotationProcessor processor = new ServerAnnotationProcessor(cometdServlet.getBayeux());
        String response = "response";
        processor.process(new RemoteCallWithResultService(response));

        defineClass(Latch.class);

        evaluateScript("cometd.init({ url: '" + cometdURL + "', logLevel: '" + getLogLevel() + "' });");
        Thread.sleep(1000); // Wait for /meta/connect
View Full Code Here

    @Test
    public void testRemoteCallWithFailure() throws Exception
    {
        ServerAnnotationProcessor processor = new ServerAnnotationProcessor(cometdServlet.getBayeux());
        String failure = "response";
        processor.process(new RemoteCallWithFailureService(failure));

        defineClass(Latch.class);

        evaluateScript("cometd.init({ url: '" + cometdURL + "', logLevel: '" + getLogLevel() + "' });");
        Thread.sleep(1000); // Wait for /meta/connect
View Full Code Here

    @Test
    public void testRemoteCallTimeout() throws Exception
    {
        long timeout = 1000;
        ServerAnnotationProcessor processor = new ServerAnnotationProcessor(cometdServlet.getBayeux());
        boolean processed = processor.process(new RemoteCallTimeoutService(timeout));
        Assert.assertTrue(processed);

        defineClass(Latch.class);

        evaluateScript("cometd.init({ url: '" + cometdURL + "', logLevel: '" + getLogLevel() + "' });");
View Full Code Here

        final String request = "request";
        final String response = "response";

        ServerAnnotationProcessor processor = new ServerAnnotationProcessor(cometdServlet.getBayeux());
        boolean processed = processor.process(new RemoteCallWithCustomDataClassService(request, response));
        Assert.assertTrue(processed);

        defineClass(Latch.class);

        evaluateScript("var latch = new Latch(1);");
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.