/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

package org.apache.geronimo.gshell.application.plugin;

import org.apache.geronimo.gshell.application.ClassPath;
import org.apache.geronimo.gshell.application.plugin.activation.ActivationRule;
import org.apache.geronimo.gshell.application.plugin.bundle.Bundle;
import org.apache.geronimo.gshell.application.plugin.bundle.NoSuchBundleException;
import org.apache.geronimo.gshell.artifact.Artifact;

import java.util.Collection;
import java.util.List;

/**
 * Plugin.
 *
 * @version $Rev$ $Date$
 */
public interface Plugin
{
    String getName();

    Artifact getArtifact();

    ClassPath getClassPath();

    Collection<String> getBundleNames();

    Bundle getBundle(String name) throws NoSuchBundleException;

    List<ActivationRule> getActivationRules();

    void setActivationRules(List<ActivationRule> rules);

    void activate();
}