1 19 20 package com.sslexplorer.extensions.types; 21 22 import java.io.File ; 23 import java.net.URL ; 24 import java.util.ArrayList ; 25 import java.util.Iterator ; 26 import java.util.List ; 27 28 import com.sslexplorer.extensions.ExtensionDescriptor; 29 30 33 public class PluginDefinition implements Comparable { 34 35 private List <URL > classPath, resourceBases; 36 private String name, className; 37 private int order; 38 private PluginStatus status; 39 private ExtensionDescriptor descriptor; 40 private List nativeDirectories; 41 42 47 public PluginDefinition(ExtensionDescriptor descriptor) { 48 classPath = new ArrayList <URL >(); 49 resourceBases = new ArrayList <URL >(); 50 status = new PluginStatus(); 51 nativeDirectories = new ArrayList (); 52 this.descriptor = descriptor; 53 } 54 55 public String getName() { 56 return name; 57 } 58 59 public void addResourceBase(URL url) { 60 resourceBases.add(url); 61 } 62 63 public void removeResourceBase(URL url) { 64 resourceBases.remove(url); 65 } 66 67 public void setDescriptor(ExtensionDescriptor descriptor) { 68 this.descriptor = descriptor; 69 } 70 71 public static void main(String [] args) { 72 } 73 76 public String getClassName() { 77 return className; 78 } 79 82 public void setName(String name) { 83 this.name = name; 84 } 85 88 public void setClassName(String className) { 89 this.className = className; 90 } 91 94 public List <URL > getClassPath() { 95 return classPath; 96 } 97 100 public void setClassPath(List classPath) { 101 this.classPath = classPath; 102 } 103 104 107 public ExtensionDescriptor getDescriptor() { 108 return descriptor; 109 } 110 113 public void setStatus(PluginStatus status) { 114 this.status = status; 115 } 116 119 public int getOrder() { 120 return order; 121 } 122 125 public void setOrder(int order) { 126 this.order = order; 127 } 128 129 134 public int compareTo(Object arg0) { 135 return new Integer (getOrder()).compareTo(new Integer (((PluginDefinition) arg0).getOrder())); 136 } 137 138 public PluginStatus getStatus() { 139 return status; 140 } 141 142 143 144 public class PluginStatus { 145 Throwable exception; 146 int status; 147 148 public PluginStatus() { 149 } 150 151 public int getStatus() { 152 return status; 153 } 154 155 public Throwable getException() { 156 return exception; 157 } 158 } 159 160 161 162 165 public void addClassPath(URL url) { 166 classPath.add(url); 167 } 168 169 172 public List <URL > getResourceBases() { 173 return resourceBases; 174 } 175 176 public void addNativeDirectory(File directory) { 177 nativeDirectories.add(directory); 178 } 179 180 183 public Iterator getNativeDirectories() { 184 return nativeDirectories.iterator(); 185 } 186 } 187 | Popular Tags |