Examples of Listener


Examples of org.apache.felix.ipojo.runtime.core.test.services.Listener

    HelloService service;

    private Listener listener;

    public DefaultLeakingService() {
        listener = new Listener() {
            // When the Hello Service will become unavailable, calling doSomething should use a nullable object.
            // Therefore, it should return 'null'.
            @Override
            public String doSomething() {
                return service.hello("iPOJO");
View Full Code Here

Examples of org.apache.ftpserver.listener.Listener

        ListenerFactory listenerFactory = new ListenerFactory();
        listenerFactory.setPort(0);
       
        // let's create two listeners on the same port, second should not start
    
        Listener defaultListener = listenerFactory.createListener();
        Listener secondListener = listenerFactory.createListener();
       
       
        serverFactory.addListener("default", defaultListener);
        serverFactory.addListener("second", secondListener);
       
        FtpServer server = serverFactory.createServer();
       
        try {
            server.start();
           
            // Windows seems to allow for both listeners to bind on the same port...
            //fail("Must throw FtpServerConfigurationException");
        } catch(FtpServerConfigurationException e) {
            if(e.getCause() instanceof BindException) {
                // OK!
               
                // we failed to start, make sure things are shut down correctly
                assertTrue(defaultListener.isStopped());
                assertTrue(secondListener.isStopped());
                assertTrue(server.isStopped());
            } else {
                throw e;
            }
        }
View Full Code Here

Examples of org.apache.ftpserver.listener.Listener

        Map<String, Listener> listeners = server.getServerContext()
                .getListeners();
        assertEquals(3, listeners.size());

        Listener listener = listeners.get("listener0");
        assertNotNull(listener);
        assertTrue(listener instanceof NioListener);
        assertEquals(2222, ((NioListener) listener).getPort());
        assertEquals(InetAddress.getByName("1.2.3.4"), InetAddress.getByName(((NioListener) listener)
                .getServerAddress()));
        assertEquals(100, ((NioListener) listener)
                .getDataConnectionConfiguration().getIdleTime());
        assertTrue(((NioListener) listener)
                .getDataConnectionConfiguration().isActiveEnabled());
        assertTrue(((NioListener) listener)
                .getDataConnectionConfiguration().isImplicitSsl());
       
        assertEquals(InetAddress.getByName("1.2.3.4"), InetAddress.getByName(((NioListener) listener)
            .getDataConnectionConfiguration().getActiveLocalAddress()) );
        assertEquals("123-125", ((NioListener) listener)
                .getDataConnectionConfiguration().getPassivePorts());
        assertEquals(false, ((NioListener) listener)
                .getDataConnectionConfiguration().isPassiveIpCheck());
       
        RemoteIpFilter filter = (RemoteIpFilter) listener.getSessionFilter();
        assertEquals(3, filter.size());
        assertTrue(filter.contains(new Subnet(InetAddress.getByName("1.2.3.0"), 16)));
        assertTrue(filter.contains(new Subnet(InetAddress.getByName("1.2.4.0"), 16)));
        assertTrue(filter.contains(new Subnet(InetAddress.getByName("1.2.3.4"), 32)));
        listener = listeners.get("listener1");
        assertNotNull(listener);
        assertTrue(listener instanceof MyCustomListener);
        assertEquals(2223, listener.getPort());

        listener = listeners.get("listener2");
        assertNotNull(listener);
        assertTrue(listener instanceof MyCustomListener);
        assertEquals(2224, listener.getPort());

        CommandFactory cf = server.getCommandFactory();
        assertTrue(cf.getCommand("FOO") instanceof HELP);
        assertTrue(cf.getCommand("FOO2") instanceof STAT);
View Full Code Here

Examples of org.apache.jetspeed.om.portlet.Listener

        FilterMapping mapping2 = app.addFilterMapping("filter-2");
        mapping2.addPortletName("Portlet 1");
        mapping2.addPortletName("Portlet 2");
        mapping2.addPortletName("Portlet 3");
       
        Listener listener1 = app.addListener("org.apache.listener.ListenerOne");
        Description d5 = listener1.addDescription("en");
        d5.setDescription("Listen to me once");
        Description d6 = listener1.addDescription("fr");
        d6.setDescription("�coutez moi une fois");
        DisplayName dn5 = listener1.addDisplayName("en");
        dn5.setDisplayName("Listen to me twice");
        DisplayName dn6 = listener1.addDisplayName("fr");
        dn6.setDisplayName("�coutez moi deux fois");
        Listener listener2 = app.addListener("org.apache.listener.ListenerTwo");
        Description d7 = listener2.addDescription("en");
        d7.setDescription("Don't listen to me");
        Description d8 = listener2.addDescription("fr");
        d8.setDescription("N'�coutez pas moi");
        DisplayName dn7 = listener2.addDisplayName("en");
        dn7.setDisplayName("Listen!");
        DisplayName dn8 = listener2.addDisplayName("fr");
        dn8.setDisplayName("�coutez!");
       
        SecurityConstraint sc = app.addSecurityConstraint(UserDataConstraint.INTEGRAL);
        DisplayName scdn1 = sc.addDisplayName("en");
        scdn1.setDisplayName("Integral Security Transport");
View Full Code Here

Examples of org.apache.openejb.jee.Listener

    public static TldTaglib readTldTaglib(URL url) throws OpenEJBException {
        // TOMEE-164 Optimization on reading built-in tld files
        if (url.getPath().contains("jstl-1.2.jar")) return new TldTaglib();
        if (url.getPath().contains("myfaces-impl")) {
            final TldTaglib taglib = new TldTaglib();
            final Listener listener = new Listener();
            listener.setListenerClass("org.apache.myfaces.webapp.StartupServletContextListener");
            taglib.getListener().add(listener);
            return taglib;
        }

        TldTaglib tldTaglib;
View Full Code Here

Examples of org.apache.qpid.proton.driver.Listener

    }

    @SuppressWarnings("rawtypes")
    public Listener listener()
    {
        Listener listener = null;
        listener = getFirstListener();
        if(listener == null)
        {
            try
            {
View Full Code Here

Examples of org.bukkit.event.Listener

 
  /**
   * Register bukkit events.
   */
  private void registerBukkitEvents() {
    listener = new Listener() {
      @EventHandler(priority = EventPriority.LOWEST)
      public final void onPlayerLogin(PlayerLoginEvent e) {
        if (closed)
          return;
        Channel channel = getChannel(e.getPlayer());
View Full Code Here

Examples of org.eclipse.jetty.util.component.LifeCycle.Listener

            }
            _hasBeenRun = true;
        }
       
        // first things first: we need to get start()/stop() calls, so:
        Listener l = new Listener() {
            @Override
            public void lifeCycleStarting(LifeCycle event) {
                try {
                    _start();
                } catch (Exception e) {
View Full Code Here

Examples of org.eclipse.jst.j2ee.common.Listener

        ParamValue contextParam = CommonFactory.eINSTANCE.createParamValue();
        contextParam.setName("contextConfigLocation");
        contextParam.setValue("WEB-INF/spring-beans.xml");
        webApp.getContextParams().add(contextParam);

        Listener listener = CommonFactory.eINSTANCE.createListener();
        listener.setListenerClassName("org.springframework.web.context.ContextLoaderListener");
        webApp.getListeners().add(listener);
      }

      // Add PerformanceFilter
      if(usePerformanceFilter){
View Full Code Here

Examples of org.eclipse.sapphire.Listener

    {
        super.init( property );
       
        this.possibleTypesService = property.service( PossibleTypesService.class );
       
        this.possibleTypesServiceListener = new Listener()
        {
            @Override
            public void handle( final Event event )
            {
                initBindingMetadata();
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.