ejtools-cvs Mailing List for EJTools (Page 100)
Brought to you by:
letiemble
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
(471) |
May
(303) |
Jun
(176) |
Jul
(67) |
Aug
(64) |
Sep
(84) |
Oct
(148) |
Nov
(57) |
Dec
(272) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(356) |
Feb
(304) |
Mar
(214) |
Apr
(22) |
May
(7) |
Jun
(25) |
Jul
|
Aug
(5) |
Sep
(106) |
Oct
|
Nov
(95) |
Dec
(193) |
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2016 |
Jan
(2) |
Feb
(1) |
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
From: Laurent E. <let...@us...> - 2002-05-02 19:43:39
|
Update of /cvsroot/ejtools/libraries/common/src/main/net/sourceforge/ejtools/jmx In directory usw-pr-cvs1:/tmp/cvs-serv7824/common/src/main/net/sourceforge/ejtools/jmx Modified Files: MBeanAccessor.java ObjectNameFinder.java Log Message: Add some JavaDocs Index: MBeanAccessor.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/net/sourceforge/ejtools/jmx/MBeanAccessor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 Index: ObjectNameFinder.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/net/sourceforge/ejtools/jmx/ObjectNameFinder.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 |
From: Laurent E. <let...@us...> - 2002-05-02 19:39:17
|
Update of /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser In directory usw-pr-cvs1:/tmp/cvs-serv6472/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser Modified Files: Main.java Log Message: Add some JavaDocs Index: Main.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/Main.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Main.java 30 Apr 2002 21:13:19 -0000 1.2 --- Main.java 2 May 2002 19:39:14 -0000 1.3 *************** *** 7,10 **** --- 7,11 ---- package net.sourceforge.ejtools.jndibrowser; + import java.beans.Beans; import java.io.File; import java.net.URL; *************** *** 18,68 **** /** ! * Description of the Class * ! * @author letiembl ! * @created 21 mars 2002 ! * @todo Javadoc to complete ! * @todo Add log4j logs */ public class Main { ! private final static Category logger = Category.getInstance(Main.class); /** ! * The main program for the Main class * ! * @param args The command line arguments ! * @exception Exception Description of Exception */ public static void main(String[] args) throws Exception { ! File pluginDir; ! File[] plugins; LinkedList list = new LinkedList(); ! logger.debug("Building classpath..."); ! logger.debug("Scanning lib directory..."); pluginDir = new File("../lib"); plugins = pluginDir.listFiles(); for (int i = 0; i < plugins.length; i++) { ! logger.debug("Found " + plugins[i].toURL()); System.out.println(plugins[i].toURL()); list.add(plugins[i].toURL()); } ! logger.debug("Scanning lib/ext directory..."); pluginDir = new File("../lib/ext"); plugins = pluginDir.listFiles(); for (int i = 0; i < plugins.length; i++) { ! logger.debug("Found " + plugins[i].toURL()); list.add(plugins[i].toURL()); } URL[] pluginURLs = (URL[]) list.toArray(new URL[list.size()]); - Thread.currentThread().setContextClassLoader(new URLClassLoader(pluginURLs, Thread.currentThread().getContextClassLoader())); System.setSecurityManager( new SecurityManager() --- 19,76 ---- /** ! * Main class for the JNDI Browser. Construct the classloader dynamically by ! * scanning directories. Once the classloader has been built, launch the Browser ! * with a custom security manager. * ! * @author letiemble ! * @created 21 mars 2002 ! * @version $Revision$ */ public class Main { ! /** Log4j logger */ ! static Category logger = Category.getInstance(Main.class); ! /** ! * The main method * ! * @param args The command line arguments ! * @exception Exception Exception */ public static void main(String[] args) throws Exception { ! File pluginDir; ! File[] plugins; LinkedList list = new LinkedList(); ! logger.debug("Building classpath..."); ! // Store the files from lib directory ! logger.debug("Scanning lib directory..."); pluginDir = new File("../lib"); plugins = pluginDir.listFiles(); for (int i = 0; i < plugins.length; i++) { ! logger.debug("Found " + plugins[i].toURL()); System.out.println(plugins[i].toURL()); list.add(plugins[i].toURL()); } ! // Store the files from lib/ext directory ! logger.debug("Scanning lib/ext directory..."); pluginDir = new File("../lib/ext"); plugins = pluginDir.listFiles(); for (int i = 0; i < plugins.length; i++) { ! logger.debug("Found " + plugins[i].toURL()); list.add(plugins[i].toURL()); } + // Create a custom classloader URL[] pluginURLs = (URL[]) list.toArray(new URL[list.size()]); Thread.currentThread().setContextClassLoader(new URLClassLoader(pluginURLs, Thread.currentThread().getContextClassLoader())); + + // Custom security manager System.setSecurityManager( new SecurityManager() *************** *** 78,89 **** }); ! logger.debug("Launching JNDIBrowser"); AccessController.doPrivileged( new PrivilegedExceptionAction() { ! public Object run() ! throws Exception { ! java.beans.Beans.instantiate(Thread.currentThread().getContextClassLoader(), "net.sourceforge.ejtools.jndibrowser.JNDIBrowser"); return null; } --- 86,97 ---- }); ! // Create the JNDI Browser JavaBean ! logger.debug("Launching JNDIBrowser"); AccessController.doPrivileged( new PrivilegedExceptionAction() { ! public Object run() throws Exception { ! Beans.instantiate(Thread.currentThread().getContextClassLoader(), "net.sourceforge.ejtools.jndibrowser.JNDIBrowser"); return null; } |
From: Laurent E. <let...@us...> - 2002-05-02 19:25:57
|
Update of /cvsroot/ejtools/libraries/common/src/main/net/sourceforge/ejtools/jmx In directory usw-pr-cvs1:/tmp/cvs-serv1397/common/src/main/net/sourceforge/ejtools/jmx Modified Files: MBeanAccessor.java ObjectNameFinder.java Log Message: Add some JavaDocs Index: MBeanAccessor.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/net/sourceforge/ejtools/jmx/MBeanAccessor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MBeanAccessor.java 30 Apr 2002 21:07:37 -0000 1.3 --- MBeanAccessor.java 2 May 2002 19:25:53 -0000 1.4 *************** *** 13,44 **** /** ! * Description of the Interface * ! * @author laurent ! * @created 11 avril 2002 */ public interface MBeanAccessor { /** ! * Sets the attribute attribute of the MBeanAccessor object * ! * @param name The new attribute value ! * @param attribute The new attribute value */ ! public void setAttribute(ObjectName name, Attribute attribute); /** ! * Gets the mBeanInfo attribute of the MBeanAccessor object * ! * @return The mBeanInfo value */ ! public MBeanInfo getMBeanInfo(); /** ! * Gets the objectName attribute of the MBeanAccessor object * ! * @return The objectName value */ public ObjectName getObjectName(); --- 13,47 ---- /** ! * Tag interface to be implemented by object that provides access to MBean ! * informations * ! * @author letiemble ! * @created 11 avril 2002 ! * @version $Revision$ ! * @todo JavaDoc to complete */ public interface MBeanAccessor { /** ! * Gets the mBeanInfo attribute of the MBeanAccessor object * ! * @return The mBeanInfo value */ ! public MBeanInfo getMBeanInfo(); /** ! * Sets the attribute attribute of the MBeanAccessor object * ! * @param name The new attribute value ! * @param attribute The new attribute value */ ! public void setAttribute(ObjectName name, Attribute attribute); /** ! * Gets the objectName attribute of the MBeanAccessor object * ! * @return The objectName value */ public ObjectName getObjectName(); *************** *** 46,52 **** /** ! * Gets the canonicalName attribute of the MBeanAccessor object * ! * @return The canonicalName value */ public String getCanonicalName(); --- 49,55 ---- /** ! * Gets the canonicalName attribute of the MBeanAccessor object * ! * @return The canonicalName value */ public String getCanonicalName(); *************** *** 54,62 **** /** ! * Gets the attribute attribute of the MBeanAccessor object * ! * @param name Description of the Parameter ! * @param attribute Description of the Parameter ! * @return The attribute value */ public Object getAttribute(ObjectName name, String attribute); --- 57,65 ---- /** ! * Gets the attribute attribute of the MBeanAccessor object * ! * @param name Description of the Parameter ! * @param attribute Description of the Parameter ! * @return The attribute value */ public Object getAttribute(ObjectName name, String attribute); *************** *** 64,74 **** /** ! * Description of the Method * ! * @param name Description of the Parameter ! * @param action Description of the Parameter ! * @param params Description of the Parameter ! * @param signatures Description of the Parameter ! * @return Description of the Return Value */ public Object invoke(ObjectName name, String action, Object[] params, String[] signatures); --- 67,77 ---- /** ! * Description of the Method * ! * @param name Description of the Parameter ! * @param action Description of the Parameter ! * @param params Description of the Parameter ! * @param signatures Description of the Parameter ! * @return Description of the Return Value */ public Object invoke(ObjectName name, String action, Object[] params, String[] signatures); *************** *** 76,87 **** /** ! * Description of the Method * ! * @param className Description of the Parameter ! * @param name Description of the Parameter ! * @param loaderName Description of the Parameter ! * @param params Description of the Parameter ! * @param signature Description of the Parameter ! * @return Description of the Return Value */ public ObjectInstance createMBean(java.lang.String className, ObjectName name, ObjectName loaderName, java.lang.Object[] params, java.lang.String[] signature); --- 79,90 ---- /** ! * Description of the Method * ! * @param className Description of the Parameter ! * @param name Description of the Parameter ! * @param loaderName Description of the Parameter ! * @param params Description of the Parameter ! * @param signature Description of the Parameter ! * @return Description of the Return Value */ public ObjectInstance createMBean(java.lang.String className, ObjectName name, ObjectName loaderName, java.lang.Object[] params, java.lang.String[] signature); *************** *** 89,98 **** /** ! * Description of the Method * ! * @param name Description of the Parameter */ public void unregisterMBean(ObjectName name); } - --- 92,100 ---- /** ! * Description of the Method * ! * @param name Description of the Parameter */ public void unregisterMBean(ObjectName name); } Index: ObjectNameFinder.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/net/sourceforge/ejtools/jmx/ObjectNameFinder.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ObjectNameFinder.java 30 Apr 2002 21:07:37 -0000 1.2 --- ObjectNameFinder.java 2 May 2002 19:25:53 -0000 1.3 *************** *** 8,24 **** /** ! * Description of the Interface * ! * @author laurent ! * @created 11 avril 2002 */ public interface ObjectNameFinder { /** ! * Description of the Method * ! * @param objectName Description of Parameter */ public void searchObjectName(String objectName); } - --- 8,25 ---- /** ! * Interface implemented by structure that allows ObjectName search by canonical ! * string. * ! * @author letiemble ! * @created 11 avril 2002 ! * @version $Revision$ */ public interface ObjectNameFinder { /** ! * Search an ObjectName by its canonical string * ! * @param objectName Canonical value of the ObjectName to search */ public void searchObjectName(String objectName); } |
From: Laurent E. <let...@us...> - 2002-05-02 19:25:57
|
Update of /cvsroot/ejtools/libraries/common/src/main/net/sourceforge/ejtools/util In directory usw-pr-cvs1:/tmp/cvs-serv1397/common/src/main/net/sourceforge/ejtools/util Modified Files: ClassTools.java JNDI.java LimitedStack.java Sort.java Log Message: Add some JavaDocs Index: ClassTools.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/net/sourceforge/ejtools/util/ClassTools.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ClassTools.java 30 Apr 2002 21:07:38 -0000 1.2 --- ClassTools.java 2 May 2002 19:25:54 -0000 1.3 *************** *** 8,26 **** /** ! * Description of the Class * ! * @author letiembl ! * @created 25 avril 2002 */ public class ClassTools { /** ! * Getter for the class attribute * ! * @param fullPathClassName Description of Parameter ! * @return The value of class attribute */ public static Class getClass(String fullPathClassName) { if (fullPathClassName.equals("int")) { --- 8,86 ---- /** ! * Utility class to handle Class realted stuff. * ! * @author letiemble ! * @created 25 avril 2002 ! * @version $Revision$ */ public class ClassTools { + /** ! * Pretty print a full qualified class name. Specially useful for object ! * arrays. * ! * @param className The fully qualified class name ! * @return The pretty class name ! */ ! public static String classDisplay(String className) ! { ! String result = className; ! ! if (className == null) ! { ! return null; ! } ! ! if (className.startsWith("[Z")) ! { ! result = "boolean[]"; ! } ! if (className.startsWith("[C")) ! { ! result = "char[]"; ! } ! if (className.startsWith("[D")) ! { ! result = "double[]"; ! } ! if (className.startsWith("[F")) ! { ! result = "float[]"; ! } ! if (className.startsWith("[I")) ! { ! result = "int[]"; ! } ! if (className.startsWith("[S")) ! { ! result = "short[]"; ! } ! if (className.startsWith("[J")) ! { ! result = "long[]"; ! } ! if (className.startsWith("[B")) ! { ! result = "byte[]"; ! } ! if (className.startsWith("[L")) ! { ! result = className.substring(2, className.length() - 1) + "[]"; ! } ! ! return result; ! } ! ! ! /** ! * Get the class by its name. ! * ! * @param fullPathClassName The full qualified name of the class ! * @return The class if it is found, otherwise null */ public static Class getClass(String fullPathClassName) { + // Check if the class is a primitive type if (fullPathClassName.equals("int")) { *************** *** 56,59 **** --- 116,120 ---- } + // Try to load the class Class c = null; try *************** *** 63,107 **** catch (Throwable e) { } return c; - } - - - /** - * Description of the Method - * - * @param s Description of Parameter - * @return Description of the Returned Value - */ - public static String classDisplay(String s) - { - String result = s; - - if (s == null) - return null; - - if (s.startsWith("[Z")) - result = "boolean[]"; - if (s.startsWith("[C")) - result = "char[]"; - if (s.startsWith("[D")) - result = "double[]"; - if (s.startsWith("[F")) - result = "float[]"; - if (s.startsWith("[I")) - result = "int[]"; - if (s.startsWith("[S")) - result = "short[]"; - if (s.startsWith("[J")) - result = "long[]"; - if (s.startsWith("[B")) - result = "byte[]"; - if (s.startsWith("[L")) - { - result = s.substring(2, s.length() - 1) + "[]"; - } - - return result; } } --- 124,131 ---- catch (Throwable e) { + // Ignore it } return c; } } Index: JNDI.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/net/sourceforge/ejtools/util/JNDI.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JNDI.java 2 May 2002 07:34:02 -0000 1.3 --- JNDI.java 2 May 2002 19:25:54 -0000 1.4 *************** *** 16,25 **** /** ! * Utility class to access environment properties ! * for JNDI. * ! * @author letiembl ! * @created 12 novembre 2001 ! * @version $Revision$ */ public abstract class JNDI --- 16,24 ---- /** ! * Utility class to access environment properties for JNDI. * ! * @author letiemble ! * @created 12 novembre 2001 ! * @version $Revision$ */ public abstract class JNDI *************** *** 27,34 **** /** Log4j Logger */ static Category logger = Category.getInstance(JNDI.class); ! ! /** ! * Look-up for a file named jndi.properties in the ! * classpath. If found, it is load into the VM environment. */ public static void setJNDIProperties() --- 26,34 ---- /** Log4j Logger */ static Category logger = Category.getInstance(JNDI.class); ! ! ! /** ! * Look-up for a file named jndi.properties in the classpath. If found, it is ! * load into the VM environment. */ public static void setJNDIProperties() *************** *** 40,45 **** if (in != null) { ! logger.debug("Found jndi.properties in classpath"); ! // Load the jndi.properties file Properties props = new Properties(); --- 40,45 ---- if (in != null) { ! logger.debug("Found jndi.properties in classpath"); ! // Load the jndi.properties file Properties props = new Properties(); *************** *** 47,51 **** in.close(); ! logger.debug("Setting VM environment"); // Set up the environment --- 47,51 ---- in.close(); ! logger.debug("Setting VM environment"); // Set up the environment *************** *** 58,62 **** { // Ignore it ! logger.warn("Exception while loading jndi.properties " + ioe.getMessage()); } } --- 58,62 ---- { // Ignore it ! logger.warn("Exception while loading jndi.properties " + ioe.getMessage()); } } Index: LimitedStack.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/net/sourceforge/ejtools/util/LimitedStack.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LimitedStack.java 19 Apr 2002 07:05:02 -0000 1.1 --- LimitedStack.java 2 May 2002 19:25:54 -0000 1.2 *************** *** 10,25 **** /** ! * Description of the Class * ! * @author laurent ! * @created 24 décembre 2001 ! * @todo Javadoc to complete */ public class LimitedStack extends Stack { ! private int maximumSize; ! /** Constructor for the LimitedStack object */ public LimitedStack() { --- 10,27 ---- /** ! * Extension of the Stack class, which has a limited depth (FIFO stack). This ! * class doesn't allow duplicates. * ! * @author letiemble ! * @created 24 décembre 2001 ! * @version $Revision$ */ public class LimitedStack extends Stack { ! /** Maximum number elements allowed in the stack */ ! protected int maximumSize; ! /** Constructor for the LimitedStack object */ public LimitedStack() { *************** *** 29,35 **** /** ! * Constructor for the LimitedStack object * ! * @param size Description of Parameter */ public LimitedStack(int size) --- 31,37 ---- /** ! * Constructor for the LimitedStack object * ! * @param size Depth size of the stack */ public LimitedStack(int size) *************** *** 40,50 **** /** ! * Description of the Method * ! * @param item Description of Parameter ! * @return Description of the Returned Value */ public Object push(Object item) { if (this.contains(item)) { --- 42,53 ---- /** ! * Overrides the push method to limit the number of elements. * ! * @param item Item to push onto the stack ! * @return The item pushed */ public Object push(Object item) { + // Remove duplicate if (this.contains(item)) { *************** *** 53,56 **** --- 56,60 ---- else { + // If size is exceeded, remove the first in if (this.size() >= this.maximumSize) { *************** *** 58,61 **** --- 62,67 ---- } } + + // Push the item return super.push(item); } Index: Sort.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/net/sourceforge/ejtools/util/Sort.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Sort.java 30 Apr 2002 21:02:50 -0000 1.2 --- Sort.java 2 May 2002 19:25:54 -0000 1.3 *************** *** 15,141 **** /** ! * Description of the Class * ! * @author laurent ! * @created 24 décembre 2001 */ public abstract class Sort { /** ! * Gets the childrenByClass attribute of the Sort class * ! * @param enum Description of Parameter ! * @param c Description of Parameter ! * @return The childrenByClass value */ ! public static Iterator getChildrenByClass(Iterator enum, Class c) { ! Object obj; ! Vector v = new Vector(); ! while (enum.hasNext()) { ! if (c.isAssignableFrom((obj = enum.next()).getClass())) { ! v.addElement(obj); } } ! return v.iterator(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param enum Description of Parameter ! * @param bean Description of Parameter ! * @param propertyName Description of Parameter ! * @return Description of the Returned Value ! */ ! public static Iterator sortByProperty(Iterator enum, Class bean, String propertyName) ! { ! Vector v = new Vector(); ! while (enum.hasNext()) ! { ! v.addElement(enum.next()); ! } ! ! try ! { ! final PropertyDescriptor pd = new PropertyDescriptor(propertyName, bean); ! final Method m = pd.getReadMethod(); ! ! Collections.sort(v, ! new Comparator() ! { ! public int compare(Object o1, Object o2) ! { ! Comparable val1; ! Comparable val2; ! ! try ! { ! val1 = (Comparable) m.invoke(o1, new Object[0]); ! val2 = (Comparable) m.invoke(o2, new Object[0]); ! } ! catch (Exception e) ! { ! return 0; ! } ! ! if (val1 == null) ! { ! return -1; ! } ! if (val2 == null) ! { ! return 1; ! } ! ! try ! { ! return val1.compareTo(val2); ! } ! catch (Exception e) ! { ! // Ignore it ! } ! return 0; ! } ! ! ! public boolean equals(Object obj) ! { ! return true; ! // Ever called? ! } ! }); ! } ! catch (Exception e) ! { ! // Ignore it ! } ! ! return v.iterator(); } /** ! * Description of the Method * ! * @param enum Description of Parameter ! * @return Description of the Returned Value */ ! public static Iterator sortByClass(Iterator enum) { ! Vector v = new Vector(); ! while (enum.hasNext()) { ! v.addElement(enum.next()); } ! Collections.sort(v, new Comparator() { public int compare(Object o1, Object o2) { --- 15,72 ---- /** ! * Utility class that provides different kind of sort strategies for Iterator. * ! * @author letiemble ! * @created 24 décembre 2001 ! * @version $Revision$ */ public abstract class Sort { /** ! * Extract the elements of the specified class from the Iterator. * ! * @param iterator Iterator to scan ! * @param clazz Class used for the extraction ! * @return The elements of the specified class */ ! public static Iterator getChildrenByClass(Iterator iterator, Class clazz) { ! Object object; ! Vector vector = new Vector(); ! ! while (iterator.hasNext()) { ! // Check if the object is instance of class ! if (clazz.isAssignableFrom((object = iterator.next()).getClass())) { ! vector.addElement(object); } } ! // Return the result ! return vector.iterator(); } /** ! * Sort the iterator by class name * ! * @param iterator Iterator to sort ! * @return The iterator sorted */ ! public static Iterator sortByClass(Iterator iterator) { ! // Create a vector from the iterator ! Vector vector = new Vector(); ! while (iterator.hasNext()) { ! vector.addElement(iterator.next()); } ! // Apply the comparator ! Collections.sort(vector, new Comparator() { + // Compare by class name public int compare(Object o1, Object o2) { *************** *** 150,172 **** } }); ! return v.iterator(); } /** ! * Description of the Method * ! * @param enum Description of Parameter ! * @return Description of the Returned Value */ ! public static Iterator sortByClassAndName(Iterator enum) { ! Vector v = new Vector(); ! while (enum.hasNext()) { ! v.addElement(enum.next()); } ! Collections.sort(v, new Comparator() { --- 81,107 ---- } }); ! ! // Return the result ! return vector.iterator(); } /** ! * Sort the iterator by class name and by toString method * ! * @param iterator Iterator to sort ! * @return The iterator sorted */ ! public static Iterator sortByClassAndName(Iterator iterator) { ! // Create a vector from the iterator ! Vector vector = new Vector(); ! while (iterator.hasNext()) { ! vector.addElement(iterator.next()); } ! // Apply the comparator ! Collections.sort(vector, new Comparator() { *************** *** 188,210 **** } }); ! return v.iterator(); } /** ! * Description of the Method * ! * @param enum Description of Parameter ! * @return Description of the Returned Value */ ! public static Iterator sortByName(Iterator enum) { ! Vector v = new Vector(); ! while (enum.hasNext()) { ! v.addElement(enum.next()); } ! Collections.sort(v, new Comparator() { --- 123,149 ---- } }); ! ! // Return the result ! return vector.iterator(); } /** ! * Sort the iterator by toString method * ! * @param iterator Iterator to sort ! * @return The iterator sorted */ ! public static Iterator sortByName(Iterator iterator) { ! // Create a vector from the iterator ! Vector vector = new Vector(); ! while (iterator.hasNext()) { ! vector.addElement(iterator.next()); } ! // Apply the comparator ! Collections.sort(vector, new Comparator() { *************** *** 221,225 **** } }); ! return v.iterator(); } } --- 160,246 ---- } }); ! ! // Return the result ! return vector.iterator(); ! } ! ! ! /** ! * Sort and iterator of JavaBeans by comparing the given property ! * ! * @param iterator Iterator to sort ! * @param clazz The class of the JavaBean ! * @param propertyName The property used for sorting ! * @return The iterator sorted ! */ ! public static Iterator sortByProperty(Iterator iterator, Class clazz, String propertyName) ! { ! // Create a vector from the iterator ! Vector vector = new Vector(); ! while (iterator.hasNext()) ! { ! vector.addElement(iterator.next()); ! } ! ! try ! { ! // Create the descriptor of the getter ! final PropertyDescriptor pd = new PropertyDescriptor(propertyName, clazz); ! final Method m = pd.getReadMethod(); ! ! // Apply the comparator ! Collections.sort(vector, ! new Comparator() ! { ! public int compare(Object o1, Object o2) ! { ! Comparable val1; ! Comparable val2; ! ! try ! { ! val1 = (Comparable) m.invoke(o1, new Object[0]); ! val2 = (Comparable) m.invoke(o2, new Object[0]); ! } ! catch (Exception e) ! { ! return 0; ! } ! ! if (val1 == null) ! { ! return -1; ! } ! if (val2 == null) ! { ! return 1; ! } ! ! try ! { ! return val1.compareTo(val2); ! } ! catch (Exception e) ! { ! // Ignore it ! } ! return 0; ! } ! ! ! public boolean equals(Object obj) ! { ! return true; ! // Ever called? ! } ! }); ! } ! catch (Exception e) ! { ! // Ignore it ! } ! ! // Return the result ! return vector.iterator(); } } |
From: Laurent E. <let...@us...> - 2002-05-02 19:25:57
|
Update of /cvsroot/ejtools/libraries/common/src/main/net/sourceforge/ejtools/servlet/http In directory usw-pr-cvs1:/tmp/cvs-serv1397/common/src/main/net/sourceforge/ejtools/servlet/http Modified Files: CharResponseWrapper.java StringResponseWrapper.java XSLFilter.java Log Message: Add some JavaDocs Index: CharResponseWrapper.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/net/sourceforge/ejtools/servlet/http/CharResponseWrapper.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CharResponseWrapper.java 30 Apr 2002 21:07:38 -0000 1.2 --- CharResponseWrapper.java 2 May 2002 19:25:54 -0000 1.3 *************** *** 1,7 **** /* ! * EJTools, the Enterprise Java Tools * ! * Distributable under LGPL license. ! * See terms of license at gnu.org. */ package net.sourceforge.ejtools.servlet.http; --- 1,7 ---- /* ! * EJTools, the Enterprise Java Tools * ! * Distributable under LGPL license. ! * See terms of license at gnu.org. */ package net.sourceforge.ejtools.servlet.http; *************** *** 14,40 **** /** ! * Description of the Interface * ! * @author laurent ! * @created 11 avril 2002 */ public class CharResponseWrapper extends HttpServletResponseWrapper { ! protected CharArrayWriter output = null; - public CharResponseWrapper(HttpServletResponse response) - { - super(response); - output = new CharArrayWriter(); - } ! public String toString() ! { ! return output.toString(); ! } ! public PrintWriter getWriter() ! { ! return new PrintWriter(output); ! } } --- 14,61 ---- /** ! * A Response wrapper that allows the manipulation of the Servlet Response. ! * Create a buffer based on a Char array. * ! * @author letiemble ! * @created 11 avril 2002 ! * @version $Revision$ */ public class CharResponseWrapper extends HttpServletResponseWrapper { ! /** Buffer used to store content */ ! protected CharArrayWriter output = null; ! /** ! * Constructor for the CharResponseWrapper object ! * ! * @param response Response stream to wrap ! */ ! public CharResponseWrapper(HttpServletResponse response) ! { ! super(response); ! output = new CharArrayWriter(); ! } ! ! /** ! * Return a writer that wraps the buffered content ! * ! * @return The writer of the wrapper ! */ ! public PrintWriter getWriter() ! { ! return new PrintWriter(output); ! } ! ! ! /** ! * Return the content of the buffer ! * ! * @return The content as String ! */ ! public String toString() ! { ! return output.toString(); ! } } Index: StringResponseWrapper.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/net/sourceforge/ejtools/servlet/http/StringResponseWrapper.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** StringResponseWrapper.java 30 Apr 2002 21:07:38 -0000 1.2 --- StringResponseWrapper.java 2 May 2002 19:25:54 -0000 1.3 *************** *** 1,7 **** /* ! * EJTools, the Enterprise Java Tools * ! * Distributable under LGPL license. ! * See terms of license at gnu.org. */ package net.sourceforge.ejtools.servlet.http; --- 1,7 ---- /* ! * EJTools, the Enterprise Java Tools * ! * Distributable under LGPL license. ! * See terms of license at gnu.org. */ package net.sourceforge.ejtools.servlet.http; *************** *** 14,40 **** /** ! * Description of the Interface * ! * @author laurent ! * @created 11 avril 2002 */ public class StringResponseWrapper extends HttpServletResponseWrapper { ! protected StringWriter output = null; - public StringResponseWrapper(HttpServletResponse response) - { - super(response); - output = new StringWriter(); - } ! public String toString() ! { ! return output.toString(); ! } ! public PrintWriter getWriter() ! { ! return new PrintWriter(output); ! } } --- 14,61 ---- /** ! * A Response wrapper that allows the manipulation of the Servlet Response. ! * Create a buffer based on a String. * ! * @author letiemble ! * @created 11 avril 2002 ! * @version $Revision$ */ public class StringResponseWrapper extends HttpServletResponseWrapper { ! /** Buffer used to store content */ ! protected StringWriter output = null; ! /** ! * Constructor for the StringResponseWrapper object ! * ! * @param response Response stream to wrap ! */ ! public StringResponseWrapper(HttpServletResponse response) ! { ! super(response); ! output = new StringWriter(); ! } ! ! /** ! * Return a writer that wraps the buffered content ! * ! * @return The writer of the wrapper ! */ ! public PrintWriter getWriter() ! { ! return new PrintWriter(output); ! } ! ! ! /** ! * Return the content of the buffer ! * ! * @return The content as String ! */ ! public String toString() ! { ! return output.toString(); ! } } Index: XSLFilter.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/net/sourceforge/ejtools/servlet/http/XSLFilter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** XSLFilter.java 30 Apr 2002 21:07:38 -0000 1.3 --- XSLFilter.java 2 May 2002 19:25:54 -0000 1.4 *************** *** 1,7 **** /* ! * EJTools, the Enterprise Java Tools * ! * Distributable under LGPL license. ! * See terms of license at gnu.org. */ package net.sourceforge.ejtools.servlet.http; --- 1,7 ---- /* ! * EJTools, the Enterprise Java Tools * ! * Distributable under LGPL license. ! * See terms of license at gnu.org. */ package net.sourceforge.ejtools.servlet.http; *************** *** 25,97 **** import javax.xml.transform.stream.StreamSource; /** ! * Description of the Interface * ! * @author laurent ! * @created 11 avril 2002 */ public class XSLFilter implements Filter { ! protected Transformer transformer = null; ! protected String stylePath = null; ! protected String contentType = null; ! protected FilterConfig config = null; - public void init(FilterConfig config) throws ServletException - { - this.config = config; ! this.contentType = config.getInitParameter("mime-type"); ! System.out.println("Acquiring parameter mime-type=" + contentType); ! String styleSheet = config.getInitParameter("stylesheet"); ! System.out.println("Acquiring parameter stylesheet=" + styleSheet); ! String stylePath = config.getServletContext().getRealPath(styleSheet); - try - { - System.out.println("Compiling stylesheet..."); - TransformerFactory tFactory = TransformerFactory.newInstance(); - transformer = tFactory.newTransformer(new StreamSource(stylePath)); - } - catch (Exception e) - { - System.out.println(e.toString()); - } - } ! public void destroy() ! { ! this.config = null; ! } ! public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException ! { ! response.setContentType(contentType); ! PrintWriter out = response.getWriter(); ! StringResponseWrapper wrapper = new StringResponseWrapper((HttpServletResponse) response); ! chain.doFilter(request, wrapper); ! StringReader reader = new StringReader(wrapper.toString()); ! Source source = new StreamSource(reader); ! try ! { ! System.out.println("Creating Writer..."); ! StringWriter writer = new StringWriter(); ! StreamResult result = new StreamResult(writer); ! System.out.println("Applying stylesheet..."); ! transformer.transform(source, result); ! System.out.println("Ouputing..."); ! response.setContentLength(writer.toString().length()); ! out.println(writer.toString()); ! } ! catch (Exception e) ! { ! out.println(e.toString()); ! out.println(wrapper.toString()); ! } ! } } --- 25,140 ---- import javax.xml.transform.stream.StreamSource; + import org.apache.log4j.Category; + /** ! * HTTP Servlet filter that applies a XSL stylesheet on a XML stream. * ! * @author letiemble ! * @created 11 avril 2002 ! * @version $Revision$ */ public class XSLFilter implements Filter { ! /** Filter configuration */ ! protected FilterConfig config = null; ! /** Content type of the output */ ! protected String contentType = null; ! /** Absolute path the stylesheet */ ! protected String stylePath = null; ! /** XSL transformer */ ! protected Transformer transformer = null; ! /** Log4j Logger */ ! protected static Category logger = Category.getInstance(XSLFilter.class); ! /** Destroy the filter */ ! public void destroy() ! { ! this.config = null; ! } ! /** ! * Main method of the filter ! * ! * @param request Incoming request ! * @param response Outgoing response ! * @param chain Filter chain to forward the request and the ! * response ! * @exception IOException In case of error ! * @exception ServletException In case of error ! */ ! public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException ! { ! // Set content type and get the original response ! response.setContentType(contentType); ! PrintWriter out = response.getWriter(); ! // Wrap the response with a buffer and follow the chain ! StringResponseWrapper wrapper = new StringResponseWrapper((HttpServletResponse) response); ! chain.doFilter(request, wrapper); ! // Create a reader with the result ! StringReader reader = new StringReader(wrapper.toString()); ! Source source = new StreamSource(reader); ! try ! { ! // Create the final response writer ! logger.debug("Creating Writer..."); ! StringWriter writer = new StringWriter(); ! StreamResult result = new StreamResult(writer); ! // Transform according to XSL stylesheet ! logger.debug("Applying stylesheet..."); ! transformer.transform(source, result); ! // Print out the result ! logger.debug("Ouputing..."); ! response.setContentLength(writer.toString().length()); ! out.println(writer.toString()); ! } ! catch (Exception e) ! { ! logger.error("Error during transformation " + e.getMessage()); ! out.println(wrapper.toString()); ! } ! } ! ! /** ! * Performs the initialization of the filter ! * ! * @param config The filter configuration ! * @exception ServletException Exception thrown if the filter was not ! * properly configured ! */ ! public void init(FilterConfig config) throws ServletException ! { ! this.config = config; ! ! // Get the content type ! this.contentType = config.getInitParameter("mime-type"); ! logger.debug("Acquiring parameter mime-type=" + contentType); ! ! // Get the stylesheet ! String styleSheet = config.getInitParameter("stylesheet"); ! logger.debug("Acquiring parameter stylesheet=" + styleSheet); ! ! // Set the absolute position of the stylesheet ! String stylePath = config.getServletContext().getRealPath(styleSheet); ! ! try ! { ! // Prepare the XSL transformer ! logger.debug("Compiling stylesheet..."); ! TransformerFactory tFactory = TransformerFactory.newInstance(); ! transformer = tFactory.newTransformer(new StreamSource(stylePath)); ! } ! catch (Exception e) ! { ! logger.fatal("Failed to init the filter " + e.getMessage()); ! throw new ServletException(e.getMessage()); ! } ! } } |
From: Laurent E. <let...@us...> - 2002-05-02 07:38:05
|
Update of /cvsroot/ejtools/libraries/common/src/main/net/sourceforge/ejtools/util In directory usw-pr-cvs1:/tmp/cvs-serv7306/common/src/main/net/sourceforge/ejtools/util Modified Files: JNDI.java Log Message: Add log4j statementJavaDoc complete Index: JNDI.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/net/sourceforge/ejtools/util/JNDI.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JNDI.java 30 Apr 2002 21:07:38 -0000 1.2 --- JNDI.java 2 May 2002 07:34:02 -0000 1.3 *************** *** 13,25 **** import javax.naming.Context; /** ! * Description of the Class * * @author letiembl * @created 12 novembre 2001 */ public abstract class JNDI { ! /** Description of the Method */ public static void setJNDIProperties() { --- 13,35 ---- import javax.naming.Context; + import org.apache.log4j.Category; + /** ! * Utility class to access environment properties ! * for JNDI. * * @author letiembl * @created 12 novembre 2001 + * @version $Revision$ */ public abstract class JNDI { ! /** Log4j Logger */ ! static Category logger = Category.getInstance(JNDI.class); ! ! /** ! * Look-up for a file named jndi.properties in the ! * classpath. If found, it is load into the VM environment. ! */ public static void setJNDIProperties() { *************** *** 30,39 **** if (in != null) { ! // Load the jndi properties file Properties props = new Properties(); props.load(in); in.close(); ! System.out.println("Setting System Properties"); // Set up the environment --- 40,51 ---- if (in != null) { ! logger.debug("Found jndi.properties in classpath"); ! ! // Load the jndi.properties file Properties props = new Properties(); props.load(in); in.close(); ! logger.debug("Setting VM environment"); // Set up the environment *************** *** 45,52 **** catch (IOException ioe) { - ioe.printStackTrace(); // Ignore it } } } - --- 57,63 ---- catch (IOException ioe) { // Ignore it + logger.warn("Exception while loading jndi.properties " + ioe.getMessage()); } } } |
From: Laurent E. <let...@us...> - 2002-05-01 18:45:32
|
Update of /cvsroot/ejtools/libraries/jboss.provider/src/main/org/jboss/enterprise/deploy/spi In directory usw-pr-cvs1:/tmp/cvs-serv15366/jboss.provider/src/main/org/jboss/enterprise/deploy/spi Added Files: JBoss30DConfigBean.java JBoss30DConfigBeanRoot.java JBoss30DeploymentConfiguration.java JBoss30DeploymentManager.java JBoss30Target.java JBoss30TargetModuleID.java Log Message: Initial Import --- NEW FILE: JBoss30DConfigBean.java --- package org.jboss.enterprise.deploy.spi; import java.beans.PropertyChangeListener; import javax.enterprise.deploy.model.*; import javax.enterprise.deploy.spi.DConfigBean; import javax.enterprise.deploy.spi.exceptions.BeanNotFoundException; import javax.enterprise.deploy.spi.exceptions.ConfigurationException; /** * The interface for configuring a server-specific deployment * descriptor, or subset of same. A DConfigBean corresponds * to a specific location in a standard deployment * descriptor, typically where values (such as names * and roles) are used. * * <p> * There are three different ways that DConfigBeans are created: * <ul> * <LI> <CODE>DeploymentConfigurator.getDConfigBean(DDBeanRoot)</CODE> * is called by the deployment tool to create a DConfigBeanRoot for each * deployment descriptor in the J2EE application. * </li> * <li> <CODE>DConfigBean.getDConfigBean(DDBean)</CODE> is called * by the deployment tool for each DDBean that corresponds to * a relative XPath pattern given to the deployment tool by the method * <CODE>DConfigBean.getXpaths().</CODE> * </li> * <li> Each DConfigBean can structure its configurations as a tree-structure * of DConfigBeans; a DConfigBean can have properties of type DConfigBean * or DConfigBean[]. * </li> * </ul> * * <p> * The properties of DConfigBeans are displayed and edited by the * deployment tool by using the JavaBean Property classes. * * @author letiembl * @created 15 avril 2002 */ public class JBoss30DConfigBean implements DConfigBean { /** * Return the JavaBean containing the deployment * descriptor XML text associated with this DConfigBean. * * @return The bean class containing the XML text for * this DConfigBean. */ public DDBean getDDBean() { return null; } /** * Return a list of XPaths designating the deployment descriptor * information this DConfigBean requires. * * A given server vendor will need to specify some server-specific * information. Each String returned by this method is an XPath * describing a certain portion of the standard deployment descriptor * for which there is corresponding server-specific configuration. * * @return a list of XPath Strings representing XML data to be retrieved * or 'null' if there are none. */ public String[] getXpaths() { return null; } /** * Return the JavaBean containing the server-specific deployment * configuration information based upon the XML data provided * by the DDBean. * * @param bean The DDBean containing the XML data to be * evaluated. * @return The DConfigBean to display the server-specific properties * for the standard bean. * @throws ConfigurationException reports errors in generating * a configuration bean. This DDBean is considered * undeployable to this server until this exception * is resolved. * A suitably descriptive message is required so the user * can diagnose the error. */ public DConfigBean getDConfigBean(DDBean bean) throws ConfigurationException { return null; } /** * Remove a child DConfigBean from this bean. * * @param bean The child DConfigBean to be removed. * @throws BeanNotFoundException the bean provided * is not in the child list of this bean. */ public void removeDConfigBean(DConfigBean bean) throws BeanNotFoundException { } /** * A notification that the DDBean provided in the * event has changed and this bean or its child beans need * to reevaluate themselves. * * @param event an event containing a reference to the * DDBean which has changed. */ public void notifyDDChange(XpathEvent event) { } /** * Register a property listener for this bean. * * @param pcl PropertyChangeListener to add */ public void addPropertyChangeListener(PropertyChangeListener pcl) { } /** * Unregister a property listener for this bean. * * @param pcl Listener to remove. */ public void removePropertyChangeListener(PropertyChangeListener pcl) { } } --- NEW FILE: JBoss30DConfigBeanRoot.java --- package org.jboss.enterprise.deploy.spi; /** * The DConfigBeanRoot interface represent the root of a * deployment descriptor. A DConfigBeanRoot is associated * with a DDRoot object which in turn is associated * with a specific deployment descriptor file. * * <p> Only DConfigBeanRoots are saved or restored by methods * in DeploymentConfigurator. * * @author gfink * @created 15 avril 2002 * @version */ public class JBoss30DConfigBeanRoot extends JBoss30DConfigBean { } --- NEW FILE: JBoss30DeploymentConfiguration.java --- package org.jboss.enterprise.deploy.spi; import java.io.InputStream; import java.io.OutputStream; import javax.enterprise.deploy.model.*; import javax.enterprise.deploy.spi.*; import javax.enterprise.deploy.spi.DeploymentConfiguration; import javax.enterprise.deploy.spi.exceptions.BeanNotFoundException; import javax.enterprise.deploy.spi.exceptions.ConfigurationException; /** * An interface that defines a container for all the * server-specific configuration information for a * single top-level J2EE module. The DeploymentConfiguration * object could represent a single stand alone module or an * EAR file that contains several sub-modules. * * @author letiembl * @created 15 avril 2002 */ public class JBoss30DeploymentConfiguration implements DeploymentConfiguration { /** * Returns an object that provides access to * the deployment descriptor data and classes * of a J2EE module. * * @return DeployableObject */ public DeployableObject getDeployableObject() { return null; } /** * Returns the top level configuration bean, DConfigBeanRoot, * associated with the deployment descriptor represented by * the designated DDBeanRoot bean. * * @param bean The top level bean that represents the * associated deployment descriptor. * @return the DConfigBeanRoot for editing the server-specific * properties required by the module. * @throws ConfigurationException reports errors in generating * a configuration bean */ public DConfigBeanRoot getDConfigBeanRoot(DDBeanRoot bean) throws ConfigurationException { return null; } /** * Remove the root DConfigBean and all its children. * * @param bean the top leve DConfigBean to remove. * @throws BeanNotFoundException the bean provides is * not in this beans child list. */ public void removeDConfigBean(DConfigBeanRoot bean) throws BeanNotFoundException { } /** * Restore from disk to instantated objects all the DConfigBeans * associated with a specific deployment descriptor. The beans * may be fully or partially configured. * * @param inputArchive The input stream for the file from which the * DConfigBeans should be restored. * @param bean The DDBeanRoot bean associated with the * deployment descriptor file. * @return The top most parent configuration bean, DConfigBeanRoot * @throws ConfigurationException reports errors in generating * a configuration bean */ public DConfigBeanRoot restoreDConfigBean(InputStream inputArchive, DDBeanRoot bean) throws ConfigurationException { return null; } /** * Save to disk all the configuration beans associated with * a particular deployment descriptor file. The saved data * may be fully or partially configured DConfigBeans. The * output file format is recommended to be XML. * * @param outputArchive The output stream to which the DConfigBeans * should be saved. * @param bean The top level bean, DConfigBeanRoot, from which to be save. * @throws ConfigurationException reports errors in generating * a configuration bean */ public void saveDConfigBean(OutputStream outputArchive, DConfigBeanRoot bean) throws ConfigurationException { } /** * Restore from disk to a full set of configuration beans previously * stored. * * @param inputArchive The input stream from which to restore * the Configuration. * @throws ConfigurationException reports errors in generating * a configuration bean */ public void restore(InputStream inputArchive) throws ConfigurationException { } /** * Save to disk the current set configuration beans created for * this deployable module. * It is recommended the file format be XML. * * @param outputArchive The output stream to which to save the * Configuration. * @throws ConfigurationException */ public void save(OutputStream outputArchive) throws ConfigurationException { } } --- NEW FILE: JBoss30DeploymentManager.java --- package org.jboss.enterprise.deploy.spi; import java.io.File; import java.io.InputStream; import java.util.Locale; import javax.enterprise.deploy.model.DeployableObject; import javax.enterprise.deploy.shared.DConfigBeanVersionType; import javax.enterprise.deploy.spi.*; import javax.enterprise.deploy.spi.exceptions.*; import javax.enterprise.deploy.spi.status.*; /** * The DeploymentManager object provides the core set of functions a J2EE * platform must provide for J2EE application deployment. It provides server * related information, such as, a list of deployment targets, and vendor * unique runtime configuration information. * * @author laurent * @created 31 mars 2002 */ public class JBoss30DeploymentManager implements DeploymentManager { /** Description of the Field */ protected Locale[] supportedLocale = new Locale[]{ new Locale("en", "UK"), new Locale("fr", "FR") }; /** Description of the Field */ protected boolean connected; /** Description of the Field */ protected Locale currentLocale; protected DConfigBeanVersionType versionType = DConfigBeanVersionType.V1_3_1; /** *Constructor for the DeploymentManagerImpl object * * @param uri Description of Parameter */ public JBoss30DeploymentManager(String uri) { // Assumes it is disconnected connected = false; } /** *Constructor for the DeploymentManagerImpl object * * @param uri Description of Parameter * @param username Description of Parameter * @param password Description of Parameter */ public JBoss30DeploymentManager(String uri, String username, String password) { // Assumes it is connected connected = true; } /** * Set the active locale for this implementation of * javax.enterprise.deploy.spi subpackages to run. * * @param locale The new value * @throws UnsupportedOperationException the provide locale is not * supported. */ public void setLocale(Locale locale) throws UnsupportedOperationException { if (isLocaleSupported(locale)){ currentLocale = locale; } } /** * Set the configuration beans to be used to the J2EE platform version * specificed. * * @param version a DConfigBeanVersionType * object representing the J2EE platform version for which support is * requested. * @throws DConfigBeanVersionUnsupportedException when the requested bean * version is not supported. */ public void setDConfigBeanVersion(DConfigBeanVersionType version) throws DConfigBeanVersionUnsupportedException { if (false) { throw new DConfigBeanVersionUnsupportedException(""); } versionType = version; } /** * Retrieve the list of deployment targets supported by this * DeploymentManager. * * @return A list of deployment Target designators * the user may select for application deployment or 'null' if there are * none. * @throws IllegalStateException is thrown when the method is called when * running in disconnected mode. */ public Target[] getTargets() throws IllegalStateException { if (!connected) { throw new IllegalStateException("Illegal access to getTargets"); } // TODO // Use JSR77 connection to get the targets return null; } /** * Retrieve the list of J2EE application modules distributed to the * identified targets and that are currently running on the associated * server or servers. * * @param moduleType A predefined designator for a J2EE module * type. * @param targetList A list of deployment Target designators * the user wants checked for module run status. * @return An array of TargetModuleID objects * representing the running modules or 'null' if there are none. * @throws IllegalStateException is thrown when the method is called when * running in disconnected mode. * @throws TargetException An invalid Target designator encountered. */ public TargetModuleID[] getRunningModules(int moduleType, Target[] targetList) throws TargetException, IllegalStateException { if (!connected) { throw new IllegalStateException("Illegal access to getRunningModules"); } // TODO // Use JSR77 connection to get the target module ID return null; } /** * Retrieve the list of J2EE application modules distributed to the * identified targets and that are currently not running on the associated * server or servers. * * @param moduleType A predefined designator for a J2EE module * type. * @param targetList A list of deployment Target designators * the user wants checked for module not running status. * @return An array of TargetModuleID objects * representing the non-running modules or 'null' if there are none. * @throws IllegalStateException is thrown when the method is called when * running in disconnected mode. * @throws TargetException An invalid Target designator encountered. */ public TargetModuleID[] getNonRunningModules(int moduleType, Target[] targetList) throws TargetException, IllegalStateException { if (!connected) { throw new IllegalStateException("Illegal access to getNonRunningModules"); } // TODO // Use JSR77 connection to get the target module ID return null; } /** * Retrieve the list of all J2EE application modules running or not running * on the identified targets. * * @param moduleType A predefined designator for a J2EE module * type. * @param targetList A list of deployment Target designators * the user wants checked for module not running status. * @return An array of TargetModuleID objects * representing all deployed modules running or not or 'null' if there * are no deployed modules. * @throws IllegalStateException is thrown when the method is called when * running in disconnected mode. * @throws TargetException An invalid Target designator encountered. */ public TargetModuleID[] getAvailableModules(int moduleType, Target[] targetList) throws TargetException, IllegalStateException { if (!connected) { throw new IllegalStateException("Illegal access to getAvailableModules"); } // TODO // Use JSR77 connection to get the target module ID return null; } /** * This method designates whether this platform vendor provides application * redeployment functionality. A value of true means it is supported. False * means it is not. * * @return A value of true means redeployment is supported by this * vendor's DeploymentManager. False means it is not. */ public boolean isRedeploySupported() { return true; } /** * Returns the default locale supported by this implementation of * javax.enterprise.deploy.spi subpackages. * * @return Locale the default locale for this implementation. */ public Locale getDefaultLocale() { return supportedLocale[0]; } /** * Returns the active locale this implementation of * javax.enterprise.deploy.spi subpackages is running. * * @return Locale the active locale of this implementation. */ public Locale getCurrentLocale() { return currentLocale; } /** * Returns an array of supported locales for this implementation. * * @return Locale[] the list of supported locales. */ public Locale[] getSupportedLocales() { return supportedLocale; } /** * Reports if this implementation supports the designated locale. * * @param locale Description of Parameter * @return A value of 'true' means it is support and 'false' it is * not. */ public boolean isLocaleSupported(Locale locale) { for (int i = 0; i < supportedLocale.length; i++) { if (supportedLocale[i].equals(locale)) { return true; } } return true; } /** * Returns the J2EE platform version number for which the configuration * beans are provided. The beans must have been compiled with the J2SE * version required by the J2EE platform. * * @return a DConfigBeanVersionType object representing the platform * version number for which these beans are provided. */ public DConfigBeanVersionType getDConfigBeanVersion() { return versionType; } /** * Returns 'true' if the configuration beans support the J2EE platform * version specified. It returns 'false' if the version is not supported. * * @param version a DConfigBeanVersionType object representing the J2EE * platform version for which support is requested. * @return 'true' if the version is supported and 'false if not. */ public boolean isDConfigBeanVersionSupported(DConfigBeanVersionType version) { return true; } /** * Retrieve the object that provides server-specific deployment * configuration information for the J2EE deployable component. * * @param dObj An object representing a J2EE deployable * component. * @return Description of the Returned Value * @throws InvalidModuleException The DeployableObject is an unknown or * unsupport component for this configuration tool. */ public DeploymentConfiguration createConfiguration(DeployableObject dObj) throws InvalidModuleException { return null; } /** * The distribute method performs three tasks; it validates the deployment * configuration data, generates all container specific classes and * interfaces, and moves the fully baked archive to the designated * deployment targets. * * @param targetList A list of server targets the user is * specifying this application be deployed to. * @param moduleArchive The file name of the application archive * to be disrtibuted. * @param deploymentPlan The XML file containing the runtime * configuration information associated with this application archive. * @return ProgressObject an object that tracks and * reports the status of the distribution process. * @throws IllegalStateException is thrown when the method is called when * running in disconnected mode. */ public ProgressObject distribute(Target[] targetList, File moduleArchive, File deploymentPlan) throws IllegalStateException { if (!connected) { throw new IllegalStateException("Illegal access to distribute"); } return null; } /** * The distribute method performs three tasks; it validates the deployment * configuration data, generates all container specific classes and * interfaces, and moves the fully baked archive to the designated * deployment targets. * * @param targetList A list of server targets the user is * specifying this application be deployed to. * @param moduleArchive The input stream containing the * application archive to be disrtibuted. * @param deploymentPlan The input stream containing the deployment * configuration information associated with this application archive. * @return ProgressObject an object that tracks and * reports the status of the distribution process. * @throws IllegalStateException is thrown when the method is called when * running in disconnected mode. */ public ProgressObject distribute(Target[] targetList, InputStream moduleArchive, InputStream deploymentPlan) throws IllegalStateException { if (!connected) { throw new IllegalStateException("Illegal access to distribute"); } return null; } /** * Start the application running. <p> * * Only the TargetModuleIDs which represent a root module are valid for * being started. A root TargetModuleID has no parent. A TargetModuleID with * a parent can not be individually started. A root TargetModuleID module * and all its child modules will be started. * * @param moduleIDList A array of TargetModuleID objects * representing the modules to be started. * @return ProgressObject an object that tracks and * reports the status of the start operation. * @throws IllegalStateException is thrown when the method is called when * running in disconnected mode. */ public ProgressObject start(TargetModuleID[] moduleIDList) throws IllegalStateException { if (!connected) { throw new IllegalStateException("Illegal access to start"); } return null; } /** * Stop the application running. <p> * * Only the TargetModuleIDs which represent a root module are valid for * being stopped. A root TargetModuleID has no parent. A TargetModuleID with * a parent can not be individually stopped. A root TargetModuleID module * and all its child modules will be stopped. * * @param moduleIDList A array of TargetModuleID objects * representing the modules to be stopped. * @return ProgressObject an object that tracks and * reports the status of the stop operation. * @throws IllegalStateException is thrown when the method is called when * running in disconnected mode. */ public ProgressObject stop(TargetModuleID[] moduleIDList) throws IllegalStateException { if (!connected) { throw new IllegalStateException("Illegal access to stop"); } return null; } /** * Remove the application from the target server. <p> * * Only the TargetModuleIDs which represent a root module are valid for * undeployment. A root TargetModuleID has no parent. A TargetModuleID with * a parent can not be undeployed. A root TargetModuleID module and all its * child modules will be undeployed. The root TargetModuleID module and all * its child modules must stopped before they can be undeployed. * * @param moduleIDList An array of TargetModuleID objects * representing the root modules to be stopped. * @return ProgressObject an object that tracks and * reports the status of the stop operation. * @throws IllegalStateException is thrown when the method is called when * running in disconnected mode. */ public ProgressObject undeploy(TargetModuleID[] moduleIDList) throws IllegalStateException { if (!connected) { throw new IllegalStateException("Illegal access to undeploy"); } return null; } /** * (optional) The redeploy method provides a means for updating currently * deployed J2EE applications. This is an optional method for vendor * implementation. Redeploy replaces a currently deployed application with * an updated version. The runtime configuration information for the updated * application must remain identical to the application it is updating. When * an application update is redeployed, all existing client connections to * the original running application must not be disrupted; new clients will * connect to the application update. This operation is valid for * TargetModuleIDs that represent a root module. A root TargetModuleID has * no parent. A root TargetModuleID module and all its child modules will be * redeployed. A child TargetModuleID module cannot be individually * redeployed. The redeploy operation is complete only when this action for * all the modules has completed. * * @param moduleIDList An array of designators of the * applications to be updated. * @param moduleArchive The file name of the application * archive to be disrtibuted. * @param deploymentPlan The deployment configuration * information associated with this application archive. * @return ProgressObject an object that * tracks and reports the status of the redeploy operation. * @throws IllegalStateException is thrown when the method is * called when running in disconnected mode. * @throws UnsupportedOperationException this optional command is not * supported by this implementation. */ public ProgressObject redeploy(TargetModuleID[] moduleIDList, File moduleArchive, File deploymentPlan) throws UnsupportedOperationException, IllegalStateException { if (!connected) { throw new IllegalStateException("Illegal access to redeploy"); } if (!isRedeploySupported()) { throw new UnsupportedOperationException("Redeploy is not supported"); } return null; } /** * (optional) The redeploy method provides a means for updating currently * deployed J2EE applications. This is an optional method for vendor * implementation. Redeploy replaces a currently deployed application with * an updated version. The runtime configuration information for the updated * application must remain identical to the application it is updating. When * an application update is redeployed, all existing client connections to * the original running application must not be disrupted; new clients will * connect to the application update. This operation is valid for * TargetModuleIDs that represent a root module. A root TargetModuleID has * no parent. A root TargetModuleID module and all its child modules will be * redeployed. A child TargetModuleID module cannot be individually * redeployed. The redeploy operation is complete only when this action for * all the modules has completed. * * @param moduleIDList An array of designators of the * applications to be updated. * @param moduleArchive The input stream containing the * application archive to be disrtibuted. * @param deploymentPlan The input stream containing the * runtime configuration information associated with this application * archive. * @return ProgressObject an object that * tracks and reports the status of the redeploy operation. * @throws IllegalStateException is thrown when the method is * called when running in disconnected mode. * @throws UnsupportedOperationException this optional command is not * supported by this implementation. */ public ProgressObject redeploy(TargetModuleID[] moduleIDList, InputStream moduleArchive, InputStream deploymentPlan) throws UnsupportedOperationException, IllegalStateException { if (!connected) { throw new IllegalStateException("Illegal access to redeploy"); } if (!isRedeploySupported()) { throw new UnsupportedOperationException("Redeploy is not supported"); } return null; } /** * The release method is the mechanism by which the tool signals to the * DeploymentManager that the tool does not need it to continue running * connected to the platform. The tool may be signaling it wants to run in a * disconnected mode or it is planning to shutdown. When release is called * the DeploymentManager may close any J2EE resource connections it had for * deployment configuration and perform other related resource cleanup. It * should not accept any new operation requests (i.e., distribute, start * stop, undeploy, redeploy. It should finish any operations that are * currently in process. Each ProgressObject associated with a running * operation should be marked as released (see the ProgressObject). */ public void release() { if (connected) { // TODO // Perfoms some disconnection connected = false; } } } --- NEW FILE: JBoss30Target.java --- package org.jboss.enterprise.deploy.spi; import javax.enterprise.deploy.spi.*; /** * A Target interface represents a single logical * core server of one instance of a J2EE platform * product. It is a designator for a server and * the implied location to copy a configured * application for the server to access. * * @author letiembl * @created 15 avril 2002 */ public class JBoss30Target implements Target { /** Description of the Field */ protected String name = null; /** Description of the Field */ protected String description = null; /** *Constructor for the JBoss30Target object * * @param name Description of Parameter */ public JBoss30Target(String name) { this.name = name; } /** *Constructor for the JBoss30Target object * * @param name Description of Parameter * @param description Description of Parameter */ public JBoss30Target(String name, String description) { this.name = name; this.description = description; } /** * Retrieve the name of the target server. * * @return The value of name attribute */ public String getName() { return name; } /** * Retrieve other descriptive information * about the target. * * @return The value of description attribute */ public String getDescription() { return description; } } --- NEW FILE: JBoss30TargetModuleID.java --- package org.jboss.enterprise.deploy.spi; import javax.enterprise.deploy.spi.*; /** * A TargetModuleID interface represents a unique * identifier for a deployed application module. * A deployable application module can be an EAR, * JAR, WAR or RAR file. * * A TargetModuleID can represent a root module or * a child module. A root module TargetModuleID * has no parent. It represents a deployed EAR * file or stand alone module. A child module * TargetModuleID represents a deployed sub module * of a J2EE application. * * A child TargetModuleID has only one parent, * the super module it was bundled and deployed * with. * * The identifier consists of the target name * and the unique identifier for the deployed * application module. * * @author letiembl * @created 15 avril 2002 */ public class JBoss30TargetModuleID implements TargetModuleID { /** Description of the Field */ protected Target target = null; /** Description of the Field */ protected String moduleID = null; /** *Constructor for the JBoss30TargetModuleID object * * @param target Description of Parameter * @param moduleID Description of Parameter */ public JBoss30TargetModuleID(Target target, String moduleID) { this.target = target; this.moduleID = moduleID; } /** * Retrieve the name of the target server. * this module was deployed to. * * @return Target an object representing * a server target. */ public Target getTarget() { return target; } /** * Retrieve the id assigned to represent * the deployed module. * * @return The value of moduleID attribute */ public String getModuleID() { return moduleID; } /** * Retrieve the identifier of the parent * object of this deployed module. If there * is no parent then this is the root object * deployed. The root could represent an EAR * file or it could be a stand alone module * that was deployed. * * @return the TargetModuleID of the parent * of this object. A <code>null</code> * value means this module is the root * object deployed. */ public TargetModuleID getParentTargetModuleID() { return null; } /** * Retrieve a list of identifiers of the children * of this deployed module. * * @return a list of TargetModuleIDs identifying the * childern of this object. A <code>null</code> * value means this module has no childern */ public TargetModuleID[] getChildTargetModuleID() { return null; } /** * Retrieve the identifier representing * the deployed module. * * @return Description of the Returned Value */ public String toString() { return moduleID; } } |
From: Laurent E. <let...@us...> - 2002-05-01 18:45:32
|
Update of /cvsroot/ejtools/libraries/jboss.provider/src/main/org/jboss/enterprise/deploy/spi/status In directory usw-pr-cvs1:/tmp/cvs-serv15366/jboss.provider/src/main/org/jboss/enterprise/deploy/spi/status Added Files: JBoss30ClientConfiguration.java JBoss30DeploymentStatus.java JBoss30ProgressObject.java Log Message: Initial Import --- NEW FILE: JBoss30ClientConfiguration.java --- package org.jboss.enterprise.deploy.spi.status; import java.io.Serializable; import javax.enterprise.deploy.spi.exceptions.ClientExecuteException; import javax.enterprise.deploy.spi.status.ClientConfiguration; /** * The ClientConfiguration object configures an Application * Client for execution by a deployment tool. This class * should resolve the settings for installing and running * the application client. * * @author letiembl * @created 15 avril 2002 */ /** * The ClientConfiguration object installs, configures and * executes an Application Client. This class resolves the * settings for installing and running the application client. * * @author letiembl * @created 15 avril 2002 */ public class JBoss30ClientConfiguration implements ClientConfiguration { /** * This method performs an exec and starts the * application client running in another process. * * @throws ClientExecuteException when the configuration * is incomplete. */ public void execute() throws ClientExecuteException { } } --- NEW FILE: JBoss30DeploymentStatus.java --- package org.jboss.enterprise.deploy.spi.status; import javax.enterprise.deploy.spi.*; import javax.enterprise.deploy.shared.ActionType; import javax.enterprise.deploy.shared.CommandType; import javax.enterprise.deploy.shared.StateType; import javax.enterprise.deploy.spi.status.DeploymentStatus; /** * The DeploymentStatus interface provides information about * the progress status of a deployment action. * * @author letiembl * @created 15 avril 2002 */ public class JBoss30DeploymentStatus implements DeploymentStatus { /** * Retrieve the StateType value. * * @return State value */ public int getState() { return 0; } /** * Retrieve the deployment CommandType of this event. * * @return command value */ public int getCommand() { return 0; } /** * Retrieve the deployment ActionType for this event. * * @return action value */ public int getAction() { return 0; } /** * Retrieve any additional information about the * status of this event. * * @return message text */ public String getMessage() { return null; } /** * A convience method to report if the operation is * in the completed state. * * @return true if this command has completed successfully */ public boolean isCompleted() { return false; } /** * A convience method to report if the operation is * in the failed state. * * @return true if this command has failed */ public boolean isFailed() { return false; } /** * A convience method to report if the operation is * in the running state. * * @return true if this command is still running */ public boolean isRunning() { return false; } } --- NEW FILE: JBoss30ProgressObject.java --- package org.jboss.enterprise.deploy.spi.status; import javax.enterprise.deploy.spi.*; import javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException; import javax.enterprise.deploy.spi.status.*; /** * The ProgressObject interface tracks and reports * the progress of the deployment activities, * distribute, start, stop, undeploy. * * <p>This class has an <code> optional</code> cancel * method. The support of the cancel function can * be tested by the isCancelSupported method. * </p> * * <p>The ProgressObject structure allows the * user the option of polling for status or to * provide a callback. * </p> * * @author letiembl * @created 15 avril 2002 */ public class JBoss30ProgressObject implements ProgressObject { /** * Retrieve the status of this activity. * * @return An object containing the status * information. */ public DeploymentStatus getDeploymentStatus() { return null; } /** * Retrieve the list of TargetModuleIDs successfully * processed or created by the associated DeploymentManager * operation. * * @return a list of TargetModuleIDs. */ public TargetModuleID[] getResultTargetModuleIDs() { return null; } /** * Return the ClientConfiguration object associated with the * TargetModuleID. * * @param id Description of Parameter * @return ClientConfiguration for a given TargetModuleID or * null if none exists. */ public ClientConfiguration getClientConfiguration(TargetModuleID id) { return null; } /** * Tests whether the vendor supports a cancel * opertation for deployment activities. * * @return <code>true</code> if canceling an * activity is supported by this platform. */ public boolean isCancelSupported() { return false; } /** * Tests whether the vendor supports a stop * opertation for deployment activities. * * @return <code>true</code> if canceling an * activity is supported by this platform. */ public boolean isStopSupported() { return false; } /** * (optional) * A cancel request on an in-process operation * stops all further processing of the operation and returns * the environment to it original state before the operation * was executed. An operation that has run to completion * cannot be cancelled. * * @throws OperationUnsupportedException this optional command * is not supported by this implementation. */ public void cancel() throws OperationUnsupportedException { } /** * (optional) * A stop request on an in-process operation allows the * operation on the current TargetModuleID to run to completion but * does not process any of the remaining unprocessed TargetModuleID * objects. The processed TargetModuleIDs must be returned by the * method getResultTargetModuleIDs. * * @throws OperationUnsupportedException this optional command * is not supported by this implementation. */ public void stop() throws OperationUnsupportedException { } /** * Add a listener to receive Progress events on deployment * actions. * * @param pol The feature to be added to the ProgressListener attribute * @see ProgressEvent */ public void addProgressListener(ProgressListener pol) { } /** * Remove a ProgressObject listener. * * @param pol Description of Parameter * @see ProgressEvent */ public void removeProgressListener(ProgressListener pol) { } } |
From: Laurent E. <let...@us...> - 2002-05-01 18:45:32
|
Update of /cvsroot/ejtools/libraries/jboss.provider/src/resources In directory usw-pr-cvs1:/tmp/cvs-serv15366/jboss.provider/src/resources Added Files: jboss30.properties jboss30_fr_FR.properties Log Message: Initial Import --- NEW FILE: jboss30.properties --- error.illegalAccess=Access to method {0} is illegal in disconnected mode error.redeployNotSupported=Redeploy functionnality is not supported --- NEW FILE: jboss30_fr_FR.properties --- (This appears to be a binary file; contents omitted.) |
From: Laurent E. <let...@us...> - 2002-05-01 18:45:32
|
Update of /cvsroot/ejtools/libraries/jboss.provider/src/main/org/jboss/enterprise/deploy/spi/factories In directory usw-pr-cvs1:/tmp/cvs-serv15366/jboss.provider/src/main/org/jboss/enterprise/deploy/spi/factories Added Files: JBoss30DeploymentFactory.java JBossDeploymentFactoryManager.java Log Message: Initial Import --- NEW FILE: JBoss30DeploymentFactory.java --- package org.jboss.enterprise.deploy.spi.factories; import javax.enterprise.deploy.spi.factories.DeploymentFactory; import javax.enterprise.deploy.spi.DeploymentManager; import javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException; import org.jboss.enterprise.deploy.spi.*; /** * Description of the Class * * @author laurent * @created 23 mars 2002 */ public class JBoss30DeploymentFactory implements DeploymentFactory { /** Description of the Field */ protected final static String DISPLAY_NAME = "JBoss Deployement Manager"; /** Description of the Field */ protected final static String PRODUCT_VERSION = "V1.0.0 - JBoss 3.0"; /** Description of the Field */ protected final static String URL_START = "deployer:jboss30:"; /** * Getter for the deploymentManager attribute * * @param uri Description of Parameter * @param username Description of Parameter * @param password Description of Parameter * @return The value * @exception DeploymentManagerCreationException Description of Exception */ public DeploymentManager getDeploymentManager(String uri, String username, String password) throws DeploymentManagerCreationException { return new JBoss30DeploymentManager(uri, username, password); } /** * Getter for the disconnectedDeploymentManager attribute * * @param uri Description of Parameter * @return The value * @exception DeploymentManagerCreationException Description of Exception */ public DeploymentManager getDisconnectedDeploymentManager(String uri) throws DeploymentManagerCreationException { return new JBoss30DeploymentManager(uri); } /** * Getter for the displayname attribute * * @return The value */ public String getDisplayname() { return DISPLAY_NAME; } /** * Getter for the productVersion attribute * * @return The value */ public String getProductVersion() { return PRODUCT_VERSION; } /** * Description of the Method * * @param uri Description of Parameter * @return Description of the Returned Value */ public boolean handlesURI(String uri) { if (uri.startsWith(URL_START)) { return true; } return false; } } --- NEW FILE: JBossDeploymentFactoryManager.java --- package org.jboss.enterprise.deploy.spi.factories; import java.util.StringTokenizer; import java.util.Vector; import javax.enterprise.deploy.spi.DeploymentManager; import javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException; import javax.enterprise.deploy.spi.factories.DeploymentFactory; import javax.enterprise.deploy.spi.factories.DeploymentFactoryManager; /** * Description of the Class * * @author laurent * @created 31 mars 2002 */ public class JBossDeploymentFactoryManager implements DeploymentFactoryManager { /** Description of the Field */ private static Vector factories = new Vector(); /** Description of the Field */ private static boolean initialized = false; /** Constructor */ public JBossDeploymentFactoryManager() { } /** * Retrieve the lists of currently registered DeploymentFactories. * * @return the list of DeploymentFactory objects or 'null' if there are * none. */ public DeploymentFactory[] getDeploymentFactories() { this.initialize(); return (DeploymentFactory[]) this.factories.toArray(new DeploymentFactory[0]); } /** * Return a <tt>disconnected</tt> DeploymentManager instance. * * @param uri identifier of the * disconnected DeploymentManager to return. * @return A DeploymentManager * instance. * @exception DeploymentManagerCreationException Description of Exception * @throws DeploymentDriverException occurs if the * DeploymentManager could not be created. */ public DeploymentManager getDisconnectedDeploymentManager(String uri) throws DeploymentManagerCreationException { this.initialize(); for (int i = 0; i < this.factories.size(); i++) { DeploymentFactory factory = (DeploymentFactory) this.factories.elementAt(i); if (factory.handlesURI(uri)) { return factory.getDisconnectedDeploymentManager(uri); } } return null; } /** * Retrieves a DeploymentManager instance to use for deployment. The caller * provides a URI and optional username and password, and all registered * DeploymentFactories will be checked. The first one to understand the URI * provided will attempt to initiate a server connection and return a ready * DeploymentManager instance. * * @param uri The uri to check * @param username An optional username (may be * <tt>null</tt> if no authentication is required for this platform). * @param password An optional password (may be * <tt>null</yy> if no authentication is required for this platform). * @return A ready DeploymentManager * instance. * @throws DeploymentManagerCreationException Occurs when the factory * appropriate to the specified URI was unable to initialize a * DeploymentManager instance (server down, unable to authenticate, * etc.). */ public DeploymentManager getDeploymentManager(String uri, String username, String password) throws DeploymentManagerCreationException { this.initialize(); for (int i = 0; i < this.factories.size(); i++) { DeploymentFactory factory = (DeploymentFactory) this.factories.elementAt(i); if (factory.handlesURI(uri)) { return factory.getDeploymentManager(uri, username, password); } } return null; } /** * Registers a DeploymentFactory so it will be able to handle requests. * * @param factory Description of Parameter */ public void registerDeploymentFactory(DeploymentFactory factory) { this.initialize(); this.factories.add(factory); } /** Description of the Method */ private void initialize() { if (this.initialized) { return; } this.initialized = true; this.loadInitialFactories(); } /** Description of the Method */ private void loadInitialFactories() { String factoriesToLoad; factoriesToLoad = System.getProperty("javax.enterprise.deploy.spi.factories"); System.out.println("ENV " + factoriesToLoad); if (factoriesToLoad == null) { return; } StringTokenizer tokenizer = new StringTokenizer(factoriesToLoad, ":"); while (tokenizer.hasMoreTokens()) { String factoryToLoad = tokenizer.nextToken(); System.out.println("NEXT " + factoryToLoad); try { DeploymentFactory factory = (DeploymentFactory) Class.forName(factoryToLoad).newInstance(); this.registerDeploymentFactory(factory); } catch (ClassNotFoundException ex) { } catch (Exception ex) { } } } } |
From: Laurent E. <let...@us...> - 2002-05-01 18:45:29
|
Update of /cvsroot/ejtools/libraries/jboss.provider/src/etc In directory usw-pr-cvs1:/tmp/cvs-serv15366/jboss.provider/src/etc Added Files: default.mf Log Message: Initial Import --- NEW FILE: default.mf --- J2EE-DeploymentFactoryManager-Implementation-Class: org.jboss.enterprise.deploy.spi.factories.JBossDeploymentFactoryManager Name: org/jboss/enterprise/deploy/spi/factories Specification-Title: @module.name@ @version.major@.@version.minor@.@version.revision@-@version.tag@ Specification-Version: @version.major@.@version.minor@.@version.revision@-@version.tag@ Specification-Vendor: EJTools Project Implementation-Title: @module.name@ @version.major@.@version.minor@.@version.revision@-@version.tag@ Implementation-Version: @version.major@.@version.minor@.@version.revision@-@version.tag@ Implementation-Vendor: EJTools Project |
From: Laurent E. <let...@us...> - 2002-05-01 18:45:24
|
Update of /cvsroot/ejtools/libraries/jboss.provider/src/main/org/jboss/enterprise/deploy/spi/status In directory usw-pr-cvs1:/tmp/cvs-serv15175/libraries/jboss.provider/src/main/org/jboss/enterprise/deploy/spi/status Log Message: Directory /cvsroot/ejtools/libraries/jboss.provider/src/main/org/jboss/enterprise/deploy/spi/status added to the repository |
From: Laurent E. <let...@us...> - 2002-05-01 18:45:24
|
Update of /cvsroot/ejtools/libraries/jboss.provider/src/main/org/jboss/enterprise/deploy/spi/services In directory usw-pr-cvs1:/tmp/cvs-serv15175/libraries/jboss.provider/src/main/org/jboss/enterprise/deploy/spi/services Log Message: Directory /cvsroot/ejtools/libraries/jboss.provider/src/main/org/jboss/enterprise/deploy/spi/services added to the repository |
From: Laurent E. <let...@us...> - 2002-05-01 18:45:23
|
Update of /cvsroot/ejtools/libraries/jboss.provider/src/resources In directory usw-pr-cvs1:/tmp/cvs-serv15175/libraries/jboss.provider/src/resources Log Message: Directory /cvsroot/ejtools/libraries/jboss.provider/src/resources added to the repository |
From: Laurent E. <let...@us...> - 2002-05-01 18:45:21
|
Update of /cvsroot/ejtools/libraries/jboss.provider/src/etc In directory usw-pr-cvs1:/tmp/cvs-serv15175/libraries/jboss.provider/src/etc Log Message: Directory /cvsroot/ejtools/libraries/jboss.provider/src/etc added to the repository |
From: Laurent E. <let...@us...> - 2002-05-01 18:45:21
|
Update of /cvsroot/ejtools/libraries/jboss.provider/src/main/org/jboss In directory usw-pr-cvs1:/tmp/cvs-serv15175/libraries/jboss.provider/src/main/org/jboss Log Message: Directory /cvsroot/ejtools/libraries/jboss.provider/src/main/org/jboss added to the repository |
From: Laurent E. <let...@us...> - 2002-05-01 18:45:21
|
Update of /cvsroot/ejtools/libraries/jboss.provider/src/main/org/jboss/enterprise/deploy/spi/factories In directory usw-pr-cvs1:/tmp/cvs-serv15175/libraries/jboss.provider/src/main/org/jboss/enterprise/deploy/spi/factories Log Message: Directory /cvsroot/ejtools/libraries/jboss.provider/src/main/org/jboss/enterprise/deploy/spi/factories added to the repository |
From: Laurent E. <let...@us...> - 2002-05-01 18:45:21
|
Update of /cvsroot/ejtools/libraries/jboss.provider/src/main/org In directory usw-pr-cvs1:/tmp/cvs-serv15175/libraries/jboss.provider/src/main/org Log Message: Directory /cvsroot/ejtools/libraries/jboss.provider/src/main/org added to the repository |
From: Laurent E. <let...@us...> - 2002-05-01 18:45:21
|
Update of /cvsroot/ejtools/libraries/jboss.provider/src/main/org/jboss/enterprise/deploy/spi In directory usw-pr-cvs1:/tmp/cvs-serv15175/libraries/jboss.provider/src/main/org/jboss/enterprise/deploy/spi Log Message: Directory /cvsroot/ejtools/libraries/jboss.provider/src/main/org/jboss/enterprise/deploy/spi added to the repository |
From: Laurent E. <let...@us...> - 2002-05-01 18:45:21
|
Update of /cvsroot/ejtools/libraries/jboss.provider/src/main/org/jboss/enterprise In directory usw-pr-cvs1:/tmp/cvs-serv15175/libraries/jboss.provider/src/main/org/jboss/enterprise Log Message: Directory /cvsroot/ejtools/libraries/jboss.provider/src/main/org/jboss/enterprise added to the repository |
From: Laurent E. <let...@us...> - 2002-05-01 18:45:21
|
Update of /cvsroot/ejtools/libraries/jboss.provider/src/main/org/jboss/enterprise/deploy In directory usw-pr-cvs1:/tmp/cvs-serv15175/libraries/jboss.provider/src/main/org/jboss/enterprise/deploy Log Message: Directory /cvsroot/ejtools/libraries/jboss.provider/src/main/org/jboss/enterprise/deploy added to the repository |
From: Laurent E. <let...@us...> - 2002-05-01 18:45:21
|
Update of /cvsroot/ejtools/libraries/jboss.provider/src/main In directory usw-pr-cvs1:/tmp/cvs-serv15175/libraries/jboss.provider/src/main Log Message: Directory /cvsroot/ejtools/libraries/jboss.provider/src/main added to the repository |
From: Laurent E. <let...@us...> - 2002-05-01 18:45:21
|
Update of /cvsroot/ejtools/libraries/jboss.provider/src In directory usw-pr-cvs1:/tmp/cvs-serv15175/libraries/jboss.provider/src Log Message: Directory /cvsroot/ejtools/libraries/jboss.provider/src added to the repository |
Update of /cvsroot/ejtools/applications/deployment/src/main/net/sourceforge/ejtools/deploy/model/metada In directory usw-pr-cvs1:/tmp/cvs-serv7562/deployment/src/main/net/sourceforge/ejtools/deploy/model/metada Removed Files: CARMetaData.java EARMetaData.java JARMetaData.java RARMetaData.java WARMetaData.java Log Message: Removed for the moment --- CARMetaData.java DELETED --- --- EARMetaData.java DELETED --- --- JARMetaData.java DELETED --- --- RARMetaData.java DELETED --- --- WARMetaData.java DELETED --- |
From: Laurent E. <let...@us...> - 2002-04-30 21:23:20
|
Update of /cvsroot/ejtools/applications/deployment/src/main/net/sourceforge/ejtools/deploy/xml In directory usw-pr-cvs1:/tmp/cvs-serv11965/applications/deployment/src/main/net/sourceforge/ejtools/deploy/xml Added Files: DTDResolver.java Log Message: Initial Import --- NEW FILE: DTDResolver.java --- package net.sourceforge.ejtools.deploy.xml; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.io.IOException; import java.util.Hashtable; import org.xml.sax.InputSource; import org.xml.sax.EntityResolver; /** * Description of the Class * * @author letiembl * @created 13 décembre 2001 */ public class DTDResolver implements EntityResolver { protected static Hashtable dtds = new Hashtable(); public DTDResolver() { } public InputSource resolveEntity (String publicId, String systemId) { byte[] data = (byte[])dtds.get(publicId); if(data != null) { return new InputSource(new ByteArrayInputStream(data)); } else { } return null; } static { dtds.put("-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN", loadDTD("ejb-jar_1_1.dtd")); dtds.put("-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN", loadDTD("ejb-jar_2_0.dtd")); dtds.put("-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN", loadDTD("application_1_2.dtd")); dtds.put("-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN", loadDTD("application_1_3.dtd")); dtds.put("-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN", loadDTD("web-app_2_3.dtd")); } private static byte[] loadDTD(String name) { InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(name); if(in == null) { in = DTDResolver.class.getClassLoader().getResourceAsStream(name); } if(in != null) { return loadBytes(in); } return null; } private static byte[] loadBytes(InputStream source) { byte[] buf = new byte[1024]; try { BufferedInputStream in = new BufferedInputStream(source); ByteArrayOutputStream out = new ByteArrayOutputStream(); int count; while((count = in.read(buf)) > -1) out.write(buf, 0, count); in.close(); out.close(); return out.toByteArray(); } catch(IOException e) { return null; } } } |