Package org.apache.karaf.cellar.core

Examples of org.apache.karaf.cellar.core.Group


        event.setSourceGroup(group);
        producer.produce(event);
    }

    public void uninstall(String groupName, String symbolicName, String version) throws Exception {
        Group group = groupManager.findGroupByName(groupName);

        if (group == null) {
            throw new IllegalArgumentException("Cluster group " + groupName + " doesn't exist");
        }
View Full Code Here


        event.setSourceGroup(group);
        producer.produce(event);
    }

    public void start(String groupName, String symbolicName, String version) throws Exception {
        Group group = groupManager.findGroupByName(groupName);

        if (group == null) {
            throw new IllegalArgumentException("Cluster group " + groupName + " doesn't exist");
        }
View Full Code Here

        event.setSourceGroup(group);
        producer.produce(event);
    }

    public void stop(String groupName, String symbolicName, String version) throws Exception {
        Group group = groupManager.findGroupByName(groupName);

        if (group == null) {
            throw new IllegalArgumentException("Cluster group " + groupName + " doesn't exist");
        }
View Full Code Here

    public void setEventTransportFactory(EventTransportFactory eventTransportFactory) {
        this.eventTransportFactory = eventTransportFactory;
    }

    public void install(String groupName, String name, String version) throws Exception {
        Group group = groupManager.findGroupByName(groupName);
        EventProducer producer = eventTransportFactory.getEventProducer(groupName,true);
        RemoteFeaturesEvent event = new RemoteFeaturesEvent(name, version, FeatureEvent.EventType.FeatureInstalled);
        event.setForce(true);
        event.setSourceGroup(group);
        producer.produce(event);
View Full Code Here

    public void install(String groupName, String name) throws Exception {
        this.install(groupName, name, null);
    }

    public void uninstall(String groupName, String name, String version) throws Exception {
        Group group = groupManager.findGroupByName(groupName);
        EventProducer producer = eventTransportFactory.getEventProducer(groupName,true);
        RemoteFeaturesEvent event = new RemoteFeaturesEvent(name, version, FeatureEvent.EventType.FeatureUninstalled);
        event.setForce(true);
        event.setSourceGroup(group);
        producer.produce(event);
View Full Code Here

     */
    public void joinGroup(String targetGroupName) {
        Node node = clusterManager.getNode();
        Map<String, Group> groups = groupManager.listGroups();
        if (groups != null && !groups.isEmpty()) {
            Group targetGroup = groups.get(targetGroupName);
            if (targetGroup == null) {
                groupManager.registerGroup(targetGroupName);
            } else if (!targetGroup.getMembers().contains(node)) {
                targetGroup.getMembers().add(node);
                groupManager.listGroups().put(targetGroupName, targetGroup);
                groupManager.registerGroup(targetGroup);
            }
        }
    }
View Full Code Here

     */
    public void quitGroup(String targetGroupName) {
        Node node = clusterManager.getNode();
        Map<String, Group> groups = groupManager.listGroups();
        if (groups != null && !groups.isEmpty()) {
            Group targetGroup = groups.get(targetGroupName);
            if (targetGroup.getMembers().contains(node)) {
                targetGroup.getMembers().remove(node);
                groupManager.unRegisterGroup(targetGroup);
            }
        }
    }
View Full Code Here

    @Override
    protected Object doExecute() throws Exception {
        ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
        try {
            Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
            Group g = groupManager.findGroupByName(group);
            List<String> nodes = new LinkedList<String>();

            if (g.getMembers() != null && !g.getMembers().isEmpty()) {
                for (Node n : g.getMembers()) {
                    nodes.add(n.getId());
                }
                doExecute(ManageGroupAction.QUIT, group, nodes);
            }
View Full Code Here

    @Argument(index = 3, name = "key", description = "The key of the property", required = true, multiValued = false)
    String value;

    @Override
    protected Object doExecute() throws Exception {
        Group group = groupManager.findGroupByName(groupName);
        Map<String, Properties> configurationTable = clusterManager.getMap(Constants.CONFIGURATION_MAP + Configurations.SEPARATOR + groupName);
        Properties properties = configurationTable.get(pid);
        if (properties == null) {
            properties = new Properties();
        }
View Full Code Here

    public void handle(RemoteConfigurationEvent event) {

        if (event == null || event.getSourceGroup() == null || node == null || node.equals(event.getSourceNode()))
            return;

        Group group = event.getSourceGroup();
        String groupName = group.getName();

        Map<String, Properties> configurationTable = clusterManager.getMap(Constants.CONFIGURATION_MAP + Configurations.SEPARATOR + groupName);

        if (eventSwitch.getStatus().equals(SwitchStatus.ON)) {
            String pid = event.getId();
View Full Code Here

TOP

Related Classes of org.apache.karaf.cellar.core.Group

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.