Examples of LogServiceImpl


Examples of org.apache.cocoon.portal.pluto.service.log.LogServiceImpl

    /* (non-Javadoc)
     * @see org.apache.avalon.framework.activity.Initializable#initialize()
     */
    public void initialize() throws Exception {
        this.staticServices.put(LogService.class.getName(),
                                this.init(new LogServiceImpl(this.getLogger())));
        this.staticServices.put(PortletDefinitionRegistry.class.getName(),
                                this.init(new PortletDefinitionRegistryImpl()));
        this.staticServices.put(InformationProviderService.class.getName(),
                this.init(new InformationProviderServiceImpl()));
        this.staticServices.put(FactoryManagerService.class.getName(),
View Full Code Here

Examples of org.apache.cocoon.portal.pluto.service.log.LogServiceImpl

    /* (non-Javadoc)
     * @see org.apache.avalon.framework.activity.Initializable#initialize()
     */
    public void initialize() throws Exception {
        this.staticServices.put(LogService.class.getName(),
                                this.init(new LogServiceImpl(this.getLogger())));
        this.staticServices.put(PortletDefinitionRegistry.class.getName(),
                                this.init(new PortletDefinitionRegistryImpl()));
        this.staticServices.put(InformationProviderService.class.getName(),
                this.init(new InformationProviderServiceImpl()));
        this.staticServices.put(FactoryManagerService.class.getName(),
View Full Code Here

Examples of org.apache.cocoon.portal.pluto.service.log.LogServiceImpl

    /* (non-Javadoc)
     * @see org.apache.avalon.framework.activity.Initializable#initialize()
     */
    public void initialize() throws Exception {
        this.staticServices.put(LogService.class.getName(),
                                this.init(new LogServiceImpl(this.getLogger())));
        this.staticServices.put(PortletDefinitionRegistry.class.getName(),
                                this.init(new PortletDefinitionRegistryImpl()));
        this.staticServices.put(InformationProviderService.class.getName(),
                this.init(new InformationProviderServiceImpl()));
        this.staticServices.put(FactoryManagerService.class.getName(),
View Full Code Here

Examples of org.apache.cocoon.portal.pluto.service.log.LogServiceImpl

    /* (non-Javadoc)
     * @see org.apache.avalon.framework.activity.Initializable#initialize()
     */
    public void initialize() throws Exception {
        this.staticServices.put(LogService.class.getName(),
                                this.init(new LogServiceImpl(this.getLogger())));
        this.staticServices.put(PortletDefinitionRegistry.class.getName(),
                                this.init(new PortletDefinitionRegistryImpl()));
        this.staticServices.put(InformationProviderService.class.getName(),
                this.init(new InformationProviderServiceImpl()));
        this.staticServices.put(FactoryManagerService.class.getName(),
View Full Code Here

Examples of org.apache.felix.ipojo.junit4osgi.plugin.log.LogServiceImpl

        List bundles = parseBundleList();
        bundles.addAll(getTestBundle());

        List activators = new ArrayList();
        m_logService = new LogServiceImpl();
        if (m_logEnable) { // Starts the log service if enabled
            activators.add(m_logService);
        } else {
            getLog().info("Log Service disabled");
        }
View Full Code Here

Examples of org.apache.felix.ipojo.junit4osgi.plugin.log.LogServiceImpl

       
        List bundles = parseBundleList();
        bundles.addAll(getTestBundle());
       
        List activators = new ArrayList();
        m_logService = new LogServiceImpl();
        if (m_logEnable) { // Starts the log service if enabled
            activators.add(m_logService);
        } else {
            getLog().info("Log Service disabled");
        }
View Full Code Here

Examples of org.apache.felix.ipojo.junit4osgi.plugin.log.LogServiceImpl

        List bundles = parseBundleList();
        bundles.addAll(getTestBundle());

        List activators = new ArrayList();
        m_logService = new LogServiceImpl();
        if (m_logEnable) { // Starts the log service if enabled
            activators.add(m_logService);
        } else {
            getLog().info("Log Service disabled");
        }
View Full Code Here

Examples of org.apache.karaf.log.core.internal.LogServiceImpl

        formatter.setInfoColor(infoColor);
        formatter.setDebugColor(debugColor);
        formatter.setTraceColor(traceColor);
        register(LogEventFormatter.class, formatter);

        LogServiceImpl logService = new LogServiceImpl(configurationAdmin, events);
        register(LogService.class, logService);

        LogMBeanImpl securityMBean = new LogMBeanImpl(logService);
        registerMBean(securityMBean, "type=log");
    }
View Full Code Here

Examples of org.jasig.portal.container.services.log.LogServiceImpl

     */
    protected void initPortletContainer(String uid) throws PortalException {

        try {
            PortletContainerEnvironmentImpl environment = new PortletContainerEnvironmentImpl();       
            LogServiceImpl logService = new LogServiceImpl();
            FactoryManagerServiceImpl factorManagerService = new FactoryManagerServiceImpl();
            InformationProviderServiceImpl informationProviderService = new InformationProviderServiceImpl();
            PropertyManagerService propertyManagerService = new PropertyManagerServiceImpl();
           
            logService.init(servletConfig, null);
            factorManagerService.init(servletConfig, null);
            informationProviderService.init(servletConfig, null);
           
            environment.addContainerService(logService);
            environment.addContainerService(factorManagerService);
View Full Code Here

Examples of org.papoose.log.LogServiceImpl

    public void test() throws Exception
    {
        Assert.assertNotNull(bundleContext);
        ExecutorService executor = new ThreadPoolExecutor(1, 5, 100, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>());

        LogServiceImpl logServiceImpl = new LogServiceImpl(bundleContext, executor);
        logServiceImpl.setLimit(100);

        logServiceImpl.start();

        bundleContext.registerService(new String[]{ LogService.class.getName(), LogReaderService.class.getName() }, logServiceImpl, null);

        try
        {
            ServiceReference sr = bundleContext.getServiceReference(LogService.class.getName());
            LogService logService = (LogService) bundleContext.getService(sr);
            sr = bundleContext.getServiceReference(LogReaderService.class.getName());
            LogReaderService logReaderService = (LogReaderService) bundleContext.getService(sr);

            final int NUM_LISTENERS = 100;
            final int NUM_MESSAGES = 1000;
            final AtomicReference<CountDownLatch> latch = new AtomicReference<CountDownLatch>();
            final AtomicInteger count = new AtomicInteger();
            final AtomicBoolean error = new AtomicBoolean(false);
            LogListener listener;
            logReaderService.addLogListener(listener = new LogListener()
            {
                int counter = 0;

                public void logged(LogEntry entry)
                {
                    error.set(error.get() || !("Test" + (counter++)).equals(entry.getMessage()));

                    count.incrementAndGet();
                    latch.get().countDown();
                }
            });

            for (int i = 1; i < NUM_LISTENERS; i++)
            {
                logReaderService.addLogListener(new LogListener()
                {
                    int counter = 0;

                    public void logged(LogEntry entry)
                    {
                        error.set(error.get() || !("Test" + (counter++)).equals(entry.getMessage()));
                        latch.get().countDown();
                    }
                });
            }

            latch.set(new CountDownLatch(NUM_LISTENERS * NUM_MESSAGES));
            for (int i = 0; i < NUM_MESSAGES; i++) logService.log(LogService.LOG_INFO, "Test" + i);

            Enumeration enumeration = logReaderService.getLog();
            for (int i = 0; i < 100; i++)
            {
                LogEntry logEntry = (LogEntry) enumeration.nextElement();
                assertEquals("Test" + (999 - i), logEntry.getMessage());
            }

            assertFalse(enumeration.hasMoreElements());

            latch.get().await();

            assertEquals(NUM_MESSAGES, count.get());
            assertFalse(error.get());

            logReaderService.removeLogListener(listener);

            latch.set(new CountDownLatch((NUM_LISTENERS - 1) * NUM_MESSAGES));
            for (int i = 0; i < NUM_MESSAGES; i++) logService.log(LogService.LOG_INFO, "Test" + i);

            latch.get().await();

            assertEquals(NUM_MESSAGES, count.get());
        }
        finally
        {
            logServiceImpl.stop();
            executor.shutdown();
        }
    }
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.