mirror of https://github.com/pf4j/pf4j.git
Decebal Suiu
12 years ago
12 changed files with 258 additions and 142 deletions
@ -0,0 +1,28 @@ |
|||||||
|
/* |
||||||
|
* Copyright 2012 Decebal Suiu |
||||||
|
* |
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with |
||||||
|
* the License. You may obtain a copy of the License in the LICENSE file, or 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 ro.fortsoft.pf4j; |
||||||
|
|
||||||
|
/** |
||||||
|
* CyclicDependencyException will be thrown if a cyclic dependency is detected. |
||||||
|
* |
||||||
|
* @author Decebal Suiu |
||||||
|
*/ |
||||||
|
class CyclicDependencyException extends PluginException { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
public CyclicDependencyException(String message) { |
||||||
|
super(message); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,49 @@ |
|||||||
|
/* |
||||||
|
* Copyright 2012 Decebal Suiu |
||||||
|
* |
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with |
||||||
|
* the License. You may obtain a copy of the License in the LICENSE file, or 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 ro.fortsoft.pf4j; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author Decebal Suiu |
||||||
|
*/ |
||||||
|
public class PluginDependency { |
||||||
|
|
||||||
|
private String pluginId; |
||||||
|
private PluginVersion pluginVersion; |
||||||
|
|
||||||
|
public PluginDependency(String dependency) { |
||||||
|
/* |
||||||
|
int index = dependency.indexOf(':'); |
||||||
|
if (index == -1) { |
||||||
|
throw new IllegalArgumentException("Illegal dependency specifier "+ dependency); |
||||||
|
} |
||||||
|
|
||||||
|
this.pluginId = dependency.substring(0, index); |
||||||
|
this.pluginVersion = PluginVersion.createVersion(dependency.substring(index + 1)); |
||||||
|
*/ |
||||||
|
this.pluginId = dependency; |
||||||
|
} |
||||||
|
|
||||||
|
public String getPluginId() { |
||||||
|
return pluginId; |
||||||
|
} |
||||||
|
|
||||||
|
public PluginVersion getPluginVersion() { |
||||||
|
return pluginVersion; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String toString() { |
||||||
|
return "PluginDependency [pluginId=" + pluginId + ", pluginVersion=" + pluginVersion + "]"; |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,34 @@ |
|||||||
|
/* |
||||||
|
* Copyright 2012 Decebal Suiu |
||||||
|
* |
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with |
||||||
|
* the License. You may obtain a copy of the License in the LICENSE file, or 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 ro.fortsoft.pf4j; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author Decebal Suiu |
||||||
|
*/ |
||||||
|
class PluginNotFoundException extends PluginException { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
private String pluginId; |
||||||
|
|
||||||
|
public PluginNotFoundException(String pluginId) { |
||||||
|
super("Plugin '" + pluginId + "' not found."); |
||||||
|
|
||||||
|
this.pluginId = pluginId; |
||||||
|
} |
||||||
|
|
||||||
|
public String getPluginId() { |
||||||
|
return pluginId; |
||||||
|
} |
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue