Package org.apache.ace.log.server.task.LogSyncTask

Examples of org.apache.ace.log.server.task.LogSyncTask.Mode


    public synchronized void updated(String pid, Dictionary dict) throws ConfigurationException {
        String name = (String) dict.get(KEY_LOG_NAME);
        if ((name == null) || "".equals(name)) {
            throw new ConfigurationException(KEY_LOG_NAME, "Log name has to be specified.");
        }
        Mode mode = Mode.PUSH;
        String modeValue = (String) dict.get(KEY_MODE);
        if ("pull".equals(modeValue)) {
          mode = Mode.PULL;
        }
        else if ("pushpull".equals(modeValue)) {
          mode = Mode.PUSHPULL;
        }

        Component oldComponent, newComponent;
       
        Properties props = new Properties();
        props.put(KEY_LOG_NAME, name);
        props.put("taskName", LogSyncTask.class.getName());
        props.put("description", "Syncs log (name=" + name + ", mode=" + mode.toString() + ") with a server.");
        String filter = "(&(" + Constants.OBJECTCLASS + "=" + LogStore.class.getName() + ")(name=" + name + "))";
        LogSyncTask service = new LogSyncTask(name, name, mode);
        newComponent = m_manager.createComponent()
        .setInterface(new String[] { Runnable.class.getName(), LogSync.class.getName() }, props)
        .setImplementation(service)
View Full Code Here

TOP

Related Classes of org.apache.ace.log.server.task.LogSyncTask.Mode

Copyright © 2018 www.massapicom. 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.