commonjava-developer Mailing List for CommonJava Open Component Project (Page 12)
Brought to you by:
johnqueso
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(10) |
Feb
(114) |
Mar
(169) |
Apr
(25) |
May
|
Jun
(5) |
Jul
(17) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <joh...@co...> - 2004-02-18 06:21:52
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-console/src/java/org/commonjava/console/option In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26752/src/java/org/commonjava/console/option Modified Files: OptionFormat.java Log Message: updated documentation in project.xml files, and added functionality to: Console: - provide convenient way to prompt the user for more information Config: - Provide snap-in container stacking, or scoping - Provide a JBoss service implementation of a snap-in container Probably other things, but I don't honestly remember everything... Index: OptionFormat.java =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-console/src/java/org/commonjava/console/option/OptionFormat.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- OptionFormat.java 18 Sep 2003 00:46:59 -0000 1.1 +++ OptionFormat.java 18 Feb 2004 06:12:32 -0000 1.2 @@ -17,6 +17,7 @@ package org.commonjava.console.option; +import java.io.File; import java.text.SimpleDateFormat; /** typesafe enumeration class that contains several implementations of itself, @@ -252,6 +253,23 @@ } }; + /** Validation format for command line parameters representing a directory. The + * isValid() method returns true if the dir doesn't yet exist, or if it does, + * if the dir is actually a directory, not a regular file. + * + * The return type for the getValue() method is actually java.io.File. + */ + public static final OptionFormat DIR_FORMAT = new OptionFormat("Directory Format"){ + public boolean isValid(String value){ + File f = new File(value); + return !f.exists() || f.isDirectory(); + } + + public Object getValue(String value){ + return new java.io.File(value); + } + }; + /** Validation format for command line parameters representing a java package. The * isValid() method checks the input against a regular expression for validity. */ @@ -299,6 +317,7 @@ DATE_FORMAT_MM_dd_yyyy, DATE_FORMAT_yyyy_MM_dd_hh_mm_ss, FILE_FORMAT, + DIR_FORMAT, JAVA_PACKAGE_FORMAT, JAVA_CLASS_FORMAT }; |
From: <joh...@co...> - 2004-02-18 06:21:51
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-console/src/java/org/commonjava/console In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26752/src/java/org/commonjava/console Added Files: PromptConfig.java SimplePrompt.java Log Message: updated documentation in project.xml files, and added functionality to: Console: - provide convenient way to prompt the user for more information Config: - Provide snap-in container stacking, or scoping - Provide a JBoss service implementation of a snap-in container Probably other things, but I don't honestly remember everything... --- NEW FILE: PromptConfig.java --- /* Created on Feb 6, 2004 */ package org.commonjava.console; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintStream; import org.commonjava.console.option.OptionFormat; import org.commonjava.lang.Verifiable; /** * @author jdcasey */ public class PromptConfig implements Verifiable { private InputStream in; private OutputStream out; private PrintStream err; private String prompt; private OptionFormat answerFormat; private String defaultValue; /** * */ public PromptConfig() { } /* (non-Javadoc) * @see org.commonjava.lang.Verifiable#verifyValid() */ public boolean verifyValid() { return in != null && out != null && err != null && prompt != null && answerFormat != null; } /** * @return */ public OptionFormat getAnswerFormat() { return answerFormat; } /** * @return */ public PrintStream getErr() { return err; } /** * @return */ public InputStream getIn() { return in; } /** * @return */ public OutputStream getOut() { return out; } /** * @return */ public String getPrompt() { return prompt; } /** * @param format */ public void setAnswerFormat(OptionFormat format) { answerFormat = format; } /** * @param stream */ public void setErr(PrintStream stream) { err = stream; } /** * @param stream */ public void setIn(InputStream stream) { in = stream; } /** * @param stream */ public void setOut(OutputStream stream) { out = stream; } /** * @param string */ public void setPrompt(String string) { prompt = string; } /** * @return */ public String getDefaultValue() { return defaultValue; } /** * @param string */ public void setDefaultValue(String string) { defaultValue = string; } } --- NEW FILE: SimplePrompt.java --- /* Created on Feb 6, 2004 */ package org.commonjava.console; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintStream; import org.commonjava.console.option.OptionFormat; /** * @author jdcasey */ public class SimplePrompt { private PromptConfig config; /** * */ public SimplePrompt(PromptConfig config) { if(!config.verifyValid()){ throw new IllegalArgumentException("Prompt configuration is not complete."); } this.config = config; } public Object prompt() throws IOException{ BufferedReader in = new BufferedReader(new InputStreamReader(config.getIn())); PrintStream out = new PrintStream(config.getOut()); PrintStream err = config.getErr(); String defaultVal = config.getDefaultValue(); String answer = null; Object result = null; while(answer == null){ out.print(config.getPrompt() + " "); out.flush(); answer = in.readLine(); OptionFormat format = config.getAnswerFormat(); if(format.isValid(answer)){ answer = null; out.println("You must supply a valid value. Please try again."); } else if(defaultVal != null && format.isValid(defaultVal)){ result = format.getValue(defaultVal); break; } else{ result = format.getValue(answer); break; } } return result; } } |
From: <joh...@co...> - 2004-02-18 06:21:51
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-console In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26752 Modified Files: project.xml Log Message: updated documentation in project.xml files, and added functionality to: Console: - provide convenient way to prompt the user for more information Config: - Provide snap-in container stacking, or scoping - Provide a JBoss service implementation of a snap-in container Probably other things, but I don't honestly remember everything... Index: project.xml =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-console/project.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- project.xml 18 Sep 2003 00:46:59 -0000 1.1 +++ project.xml 18 Feb 2004 06:12:31 -0000 1.2 @@ -3,9 +3,9 @@ <project> <pomVersion>3</pomVersion> <id>commonjava-console</id> - <name>CommonJava Console Framework</name> + <name>Console Framework</name> <groupId>commonjava</groupId> - <currentVersion>2.0</currentVersion> + <currentVersion>2.0-1</currentVersion> <organization> <name>CommonJava Open Component Project</name> <url>http://www.commonjava.org</url> @@ -13,6 +13,26 @@ <inceptionYear>2002</inceptionYear> <package>org.commonjava.console</package> + <description> + Console Framework is getopt on steroids. It contains object formatters, which transform a string + read from the command line into any number of object types, along with providing validation that + that string conforms to the definition of a valid instance of that type. It contains a Command + base object, which can accept multiple command line templates which each define a combination of + command-line options that constitute a valid invocation. Command-line templates are merely arrays + of Option instances, which in turn are specifications of a short name (invoked as '-f xxx'), + a long name (invoked as "--file=xxx"), possibly an OptionFormat value (these are a + pseudo-enumerated type with added functionality outlined above), and a description of what the + option means to the command line. The command itself is instantiated with a description of what + it does, plus an optional description of what the non-option arguments mean to the invocation. + In addition, the empty command template can be en/disabled (invocation with no options), and the + in/out/err streams can be set. + + Built on top of all this is the notion of a Console, which accepts and parses a command invocation + from somewhere into an array of strings (static void main(String[] args) style), and then looks + up the appropriate command instance and invokes it with the options. The BasicConsole has a help + command built in, which shows all available commands and their associated usages. + </description> + <dependencies> <dependency> <groupId>commonjava</groupId> |
From: <joh...@co...> - 2004-02-18 06:21:43
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26713 Modified Files: project.xml Log Message: updated documentation in project.xml files, and added functionality to: Console: - provide convenient way to prompt the user for more information Config: - Provide snap-in container stacking, or scoping - Provide a JBoss service implementation of a snap-in container Probably other things, but I don't honestly remember everything... Index: project.xml =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-lang/project.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- project.xml 2 Feb 2004 02:20:35 -0000 1.2 +++ project.xml 18 Feb 2004 06:12:24 -0000 1.3 @@ -3,7 +3,7 @@ <project> <pomVersion>3</pomVersion> <id>commonjava-lang</id> - <name>CommonJava Common Language Elements</name> + <name>Common Language</name> <groupId>commonjava</groupId> <currentVersion>2.0-1</currentVersion> <organization> @@ -13,6 +13,12 @@ <inceptionYear>2002</inceptionYear> <package>org.commonjava.lang</package> + <description> + Attempts to provide some commonplace language constructs for use in modeling. Examples include a + base set of identifier classes, along with interface definitions and support classes for object + locking, validation, reversibility, and negation. + </description> + <dependencies> <dependency> <groupId>commons-logging</groupId> |
From: <joh...@co...> - 2004-02-18 06:21:37
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-config-jndi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26691 Modified Files: project.xml Log Message: updated documentation in project.xml files, and added functionality to: Console: - provide convenient way to prompt the user for more information Config: - Provide snap-in container stacking, or scoping - Provide a JBoss service implementation of a snap-in container Probably other things, but I don't honestly remember everything... Index: project.xml =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-config-jndi/project.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- project.xml 16 Jan 2004 02:20:24 -0000 1.6 +++ project.xml 18 Feb 2004 06:12:17 -0000 1.7 @@ -3,9 +3,9 @@ <project> <pomVersion>3</pomVersion> <id>commonjava-config-jndi</id> - <name>CommonJava JNDI Configuration Point</name> + <name>JNDI Configurations</name> <groupId>commonjava</groupId> - <currentVersion>2.1-3</currentVersion> + <currentVersion>2.1-4</currentVersion> <organization> <name>CommonJava Open Component Project</name> <url>http://www.commonjava.org</url> @@ -13,11 +13,16 @@ <inceptionYear>2002</inceptionYear> <package>org.commonjava.config.jndi</package> + <description> + This project merely maintains a configuration set for JNDI environment parameters, along with + an OPL parser library used to instantiate the configuration from namespaced XML. + </description> + <dependencies> <dependency> <groupId>commonjava</groupId> <artifactId>commonjava-opl</artifactId> - <version>2.1-4</version> + <version>2.1-5</version> <url>http://www.commonjava.org</url> </dependency> @@ -31,7 +36,7 @@ <dependency> <groupId>commonjava</groupId> <artifactId>commonjava-config</artifactId> - <version>2.1</version> + <version>2.1-1</version> <url>http://www.commonjava.org</url> </dependency> |
From: <joh...@co...> - 2004-02-18 06:21:30
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-opl/src/java/org/commonjava/opl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26618/src/java/org/commonjava/opl Modified Files: NodeParser.java OPLContext.java GenericNamespaceResolver.java OPLEngine.java OPLDriver.java SAXDriver.java DocumentDriver.java Log Message: updated documentation in project.xml files, and added functionality to: Console: - provide convenient way to prompt the user for more information Config: - Provide snap-in container stacking, or scoping - Provide a JBoss service implementation of a snap-in container Probably other things, but I don't honestly remember everything... Index: NodeParser.java =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-opl/src/java/org/commonjava/opl/NodeParser.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- NodeParser.java 16 Jan 2004 01:37:33 -0000 1.13 +++ NodeParser.java 18 Feb 2004 06:12:10 -0000 1.14 @@ -422,7 +422,7 @@ mergedProperties = parent.getAccumulatedProperties(); } else{ - mergedProperties = new Properties(); + mergedProperties = new Properties(System.getProperties()); } if(this instanceof PropertiesContainer){ Index: OPLContext.java =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-opl/src/java/org/commonjava/opl/OPLContext.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- OPLContext.java 9 Jan 2004 05:07:43 -0000 1.5 +++ OPLContext.java 18 Feb 2004 06:12:10 -0000 1.6 @@ -9,6 +9,8 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.commonjava.io.IOFactory; import org.commonjava.io.IOResource; import org.commonjava.opl.dynalib.DynaLibParsingLibrary; @@ -22,6 +24,8 @@ */ public class OPLContext { + private static final Log LOG = LogFactory.getLog(OPLContext.class); + private static final String DYNALIB_NS = "dynalib"; private static final Pattern OPL_DYNALIB_NS_PATTERN = Pattern.compile("opl:(.+)"); @@ -94,6 +98,10 @@ throws NoSuchLibraryException, LibraryConfigurationException, NoSuchParserException, ParserConfigurationException { + if (LOG.isTraceEnabled()) { + LOG.trace("Loading parser for node: \'" + nodeName + "\' in namespace: \'" + namespace + "\'"); + } + ParserLibrary library = null; synchronized(this){ @@ -187,9 +195,18 @@ private ParserLibrary loadLibrary(String namespace) throws NoSuchLibraryException, LibraryConfigurationException { + if (LOG.isTraceEnabled()) { + LOG.trace("loading library for namespace: \'" + namespace + "\'"); + } + Matcher matcher = OPL_DYNALIB_NS_PATTERN.matcher(namespace); - if(namespace.matches(DYNALIB_NS)){ + if(namespace == null){ + throw new NoSuchLibraryException( + "Null namespaces are not allowed. You may need to use a NamespaceResolver." + ); + } + else if(DYNALIB_NS.equals(namespace)){ synchronized(namespace.intern()){ if(dynalibParseLib == null){ dynalibParseLib = new DynaLibParsingLibrary(namespace); Index: GenericNamespaceResolver.java =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-opl/src/java/org/commonjava/opl/GenericNamespaceResolver.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- GenericNamespaceResolver.java 9 Jan 2004 05:07:43 -0000 1.2 +++ GenericNamespaceResolver.java 18 Feb 2004 06:12:10 -0000 1.3 @@ -55,7 +55,6 @@ * @return the result of the [recursive] lookup */ private String _lookup(String namespace){ - System.out.println("looking up: " + namespace); if(namespace == null){return null;} String result = namespaceMappings.getProperty(namespace); Index: OPLEngine.java =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-opl/src/java/org/commonjava/opl/OPLEngine.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- OPLEngine.java 10 Oct 2003 00:15:46 -0000 1.4 +++ OPLEngine.java 18 Feb 2004 06:12:10 -0000 1.5 @@ -6,6 +6,7 @@ import java.io.InputStream; import org.w3c.dom.Document; +import org.w3c.dom.Node; import org.xml.sax.InputSource; /** Engine which drives the parsing of some XML data into @@ -58,6 +59,14 @@ return driver.parse(new OPLContext(ignoreUnrecognized), document); } + public Object parse(Node node) throws ParseException{ + return driver.parse(new OPLContext(), node); + } + + public Object parse(Node node, boolean ignoreUnrecognized) throws ParseException{ + return driver.parse(new OPLContext(ignoreUnrecognized), node); + } + public Object parse(String uri) throws ParseException{ return driver.parse(new OPLContext(), uri); } Index: OPLDriver.java =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-opl/src/java/org/commonjava/opl/OPLDriver.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- OPLDriver.java 16 Jan 2004 01:37:33 -0000 1.4 +++ OPLDriver.java 18 Feb 2004 06:12:10 -0000 1.5 @@ -7,6 +7,7 @@ import java.io.InputStream; import org.w3c.dom.Document; +import org.w3c.dom.Node; import org.xml.sax.InputSource; /** Driver used to fire OPL events to the current NodeParser, bind parsing @@ -39,4 +40,8 @@ public Object parse(OPLContext context, Document document) throws MissingAttributeException, ParseException; + // TODO Document + public Object parse(OPLContext context, Node node) + throws MissingAttributeException, ParseException; + } Index: SAXDriver.java =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-opl/src/java/org/commonjava/opl/SAXDriver.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- SAXDriver.java 16 Jan 2004 01:37:33 -0000 1.8 +++ SAXDriver.java 18 Feb 2004 06:12:10 -0000 1.9 @@ -10,6 +10,8 @@ import java.util.Properties; import java.util.Stack; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; @@ -17,6 +19,7 @@ import org.commonjava.io.IOFactory; import org.commonjava.io.IOResource; import org.w3c.dom.Document; +import org.w3c.dom.Node; import org.xml.sax.Attributes; import org.xml.sax.InputSource; import org.xml.sax.SAXException; @@ -147,6 +150,39 @@ return parseInternal(new InputSource(bain)); } + /** Parse the XML content in the specified DOM node object, and return the + * resulting object. This is NOT efficient for this type of driver, it is + * merely provided for (a)consistency, and (b)those developers who find + * themselves painted into a corner as far as driver choice. + * + * @param context the parsing context + * @param node the DOM node to wrap in a document, serialize and then re-parse (ick!) + * @param ignoreUnrecognized whether to ignore unrecognized element types. + * @return the parsed object + * @throws ParseException + * @see org.commonjava.opl.OPLDriver#parse(org.commonjava.opl.OPLContext, org.w3c.dom.Document, boolean) + */ + public Object parse(OPLContext context, Node node) + throws MissingAttributeException, ParseException + { + this.context = context; + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + + DocumentBuilder builder = null; + try {builder = factory.newDocumentBuilder();} + catch (ParserConfigurationException e) { + throw new ParseException("Error creating document builder to wrap node.", e); + } + + Document document = builder.newDocument(); + document.appendChild(node); + ByteArrayInputStream bain = new ByteArrayInputStream( + document.toString().getBytes() + ); + + return parseInternal(new InputSource(bain)); + } + /** Parse the XML content on the specified SAX input source, and return the * resulting object. * @param in the input source Index: DocumentDriver.java =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-opl/src/java/org/commonjava/opl/DocumentDriver.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- DocumentDriver.java 16 Jan 2004 01:37:33 -0000 1.10 +++ DocumentDriver.java 18 Feb 2004 06:12:10 -0000 1.11 @@ -31,6 +31,8 @@ */ public class DocumentDriver implements OPLDriver { + private static final Log LOG = LogFactory.getLog(DocumentDriver.class); + private static DocumentBuilderFactory FACTORY; private NodeParser parent; @@ -70,7 +72,7 @@ try { DocumentBuilder builder = FACTORY.newDocumentBuilder(); Document document = builder.parse(in); - return parseInternal(context, document); + return parseInternal(context, document.getDocumentElement()); } catch (ParserConfigurationException e) { throw new ParseException("Mis-configured JAXP.", e); @@ -106,7 +108,7 @@ Document document = builder.parse(resource.getInputStream()); resource.close(); - return parseInternal(context, document); + return parseInternal(context, document.getDocumentElement()); } catch (ParserConfigurationException e) { throw new ParseException("Mis-configured JAXP.", e); @@ -138,7 +140,7 @@ try { DocumentBuilder builder = FACTORY.newDocumentBuilder(); Document document = builder.parse(in); - return parseInternal(context, document); + return parseInternal(context, document.getDocumentElement()); } catch (ParserConfigurationException e) { throw new ParseException("Mis-configured JAXP.", e); @@ -164,7 +166,23 @@ public Object parse(OPLContext context, Document document) throws MissingAttributeException, ParseException { - return parseInternal(context, document); + return parseInternal(context, document.getDocumentElement()); + } + + /** Parse the XML content in the specified document object, and return the + * resulting object. + * + * @param context the parsing context + * @param document the DOM document to parse + * @param ignoreUnrecognized whether to ignore unrecognized element types. + * @return the parsed object + * @throws ParseException + * @see org.commonjava.opl.OPLDriver#parse(org.commonjava.opl.OPLContext, org.w3c.dom.Document, boolean) + */ + public Object parse(OPLContext context, Node node) + throws MissingAttributeException, ParseException + { + return parseInternal(context, node); } /** Traverse all elements in the specified document, building an object tree @@ -179,10 +197,26 @@ * @throws ParseException * @see org.commonjava.opl.OPLDriver#parse(java.io.InputStream, boolean) */ - private Object parseInternal(OPLContext context, Document document) + private Object parseInternal(OPLContext context, Node root) throws MissingAttributeException, ParseException { - Node root = document.getDocumentElement(); + if (LOG.isTraceEnabled()) { + LOG.trace("Root node is: " + root); + } + + if(root == null){ + throw new ParseException("Root configuration node is null. Parsing aborted."); + } + + if (LOG.isTraceEnabled()) { + LOG.trace( + "Root namespace is: \'" + root.getNamespaceURI() + "\'\n" + + "Root local name is: \'" + root.getLocalName() + "\'\n" + + "Root parent is: " + parent + "\n" + + "Root node name is: \'" + root.getNodeName() + "\'" + ); + } + NodeParser rootParser = null; if(parent != null) { rootParser = context.newParser( |
From: <joh...@co...> - 2004-02-18 06:21:30
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-opl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26618 Modified Files: project.properties .classpath project.xml .project Added Files: logging.properties Log Message: updated documentation in project.xml files, and added functionality to: Console: - provide convenient way to prompt the user for more information Config: - Provide snap-in container stacking, or scoping - Provide a JBoss service implementation of a snap-in container Probably other things, but I don't honestly remember everything... --- NEW FILE: logging.properties --- ############################################################ # Default Logging Configuration File # # You can use a different file by specifying a filename # with the java.util.logging.config.file system property. # For example java -Djava.util.logging.config.file=myfile ############################################################ ############################################################ # Global properties ############################################################ # "handlers" specifies a comma separated list of log Handler # classes. These handlers will be installed during VM startup. # Note that these classes must be on the system classpath. # By default we only configure a ConsoleHandler, which will only # show messages at the INFO and above levels. handlers= java.util.logging.ConsoleHandler # To also add the FileHandler, use the following line instead. #handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler # Default global logging level. # This specifies which kinds of events are logged across # all loggers. For any given facility this global level # can be overriden by a facility specific level # Note that the ConsoleHandler also has a separate level # setting to limit messages printed to the console. .level= INFO ############################################################ # Handler specific properties. # Describes specific configuration info for Handlers. ############################################################ # default file output is in user's home directory. java.util.logging.FileHandler.pattern = %h/java%u.log java.util.logging.FileHandler.limit = 50000 java.util.logging.FileHandler.count = 1 java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter # Limit the message that are printed on the console to INFO and above. java.util.logging.ConsoleHandler.level = FINEST java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter ############################################################ # Facility specific properties. # Provides extra control for each logger. ############################################################ # For example, set the com.xyz.foo logger to only log SEVERE # messages: org.commonjava.opl.level=FINEST Index: project.properties =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-opl/project.properties,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- project.properties 9 Jan 2004 05:07:43 -0000 1.4 +++ project.properties 18 Feb 2004 06:12:10 -0000 1.5 @@ -12,6 +12,6 @@ maven.compile.source=1.4 maven.compile.target=1.4 -maven.junit.fork=true +#maven.junit.fork=true maven.junit.usefile=${basedir}/junit.out Index: .classpath =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-opl/.classpath,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- .classpath 9 Jan 2004 05:07:43 -0000 1.7 +++ .classpath 18 Feb 2004 06:12:10 -0000 1.8 @@ -4,10 +4,10 @@ <classpathentry kind="src" output="target/test-classes" path="src/test"/> <classpathentry kind="var" path="MAVEN_REPO/junit/jars/junit-3.8.1.jar"/> <classpathentry kind="var" path="JRE_LIB" sourcepath="JRE_SRC"/> - <classpathentry kind="var" path="MAVEN_REPO/commonjava/jars/commonjava-lang-2.0.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/commonjava/jars/commonjava-io-2.0.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/commonjava/jars/commonjava-reflection-2.0.jar"/> <classpathentry kind="var" path="MAVEN_REPO/commons-logging/jars/commons-logging-1.0.2.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/commonjava/jars/commonjava-util-2.0-2.jar"/> + <classpathentry kind="src" path="/commonjava-io"/> + <classpathentry kind="src" path="/commonjava-lang"/> + <classpathentry kind="src" path="/commonjava-reflection"/> + <classpathentry kind="src" path="/commonjava-util"/> <classpathentry kind="output" path="target/classes"/> </classpath> Index: project.xml =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-opl/project.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- project.xml 9 Jan 2004 05:07:43 -0000 1.12 +++ project.xml 18 Feb 2004 06:12:10 -0000 1.13 @@ -3,9 +3,9 @@ <project> <pomVersion>3</pomVersion> <id>commonjava-opl</id> - <name>CommonJava Object Parsing Library</name> + <name>OPL: Object Parsing Library</name> <groupId>commonjava</groupId> - <currentVersion>2.1-4</currentVersion> + <currentVersion>2.1-5</currentVersion> <organization> <name>CommonJava Open Component Project</name> <url>http://www.commonjava.org</url> @@ -13,6 +13,40 @@ <inceptionYear>2002</inceptionYear> <package>org.commonjava.opl</package> + <description> + In a drastically simple nutshell, OPL is an XML parser. It supports the notion of parser-per-element + XML parsing, facilitating the construction of complex configurations and other types of objects from + the parsed XML. OPL supports dynamic attribute resolution and packaged parser library definitions, + both in the form of ParserLibrary implementation classes and in the form of XML definitions. In the + latter case, OPL uses a specially-defined meta ParserLibrary and builds the actual parser library + straight from the XML. The following is the algorithm: + <ol> + <li>Encounter new namespace.</li> + <li>If the namespace is not of the form "opl:libname", see if a NamespaceResolver has been + specified. If it has, resolve the namespace. This should render an "opl:libname" namespace.</li> + <li>Check the OPLContext for a mapped library keyed by the namespace.</li> + <li>If no mapped library is found, look for the classpath resource "META-INF/parsers/libname.opl"</li> + <li>If the resource exists, parse the ParserLibrary from the XML in that file.</li> + <li>Use the parser library to lookup/instantiate the appropriate NodeParser implementation for + the element name in question.</li> + <li>Construct an ElementInfo from the current element definition</li> + <li>Call NodeParser's doBeforeChildren() method</li> + <li>Parse sub-elements using this same algorithm</li> + <li>Collect the accumulated element body text if any</li> + <li>Call NodeParser's doAfterChildren() method</li> + </ol> + + In this way, we can start parsing the object before the children are visited, and finish afterward. + All NodeParsers have the ability to retrieve attribute values from the passed in ElementInfo object, + and can lookup their parent parser via the getParent() or findAncestorWithClass() methods. Finally, + if a NodeParser implementation also implements OPLModelRoot, this is meant to be the root node of + the XML document, and contains the additional method getParsedObject(), which will return the result + of the parsing effort. + + SAX and DOM are both supported via specific OPLDriver implementations; other XML parsers can also + be supported by re-implementing this interface with specific code to use the other parser technology. + </description> + <dependencies> <dependency> <groupId>commonjava</groupId> Index: .project =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-opl/.project,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- .project 18 Sep 2003 04:57:09 -0000 1.1 +++ .project 18 Feb 2004 06:12:10 -0000 1.2 @@ -1,19 +1,22 @@ <?xml version="1.0" encoding="UTF-8"?> - <projectDescription> - <name>commonjava-opl</name> - <comment> + <name>commonjava-opl</name> + <comment> </comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> \ No newline at end of file + <projects> + <project>commonjava-io</project> + <project>commonjava-lang</project> + <project>commonjava-reflection</project> + <project>commonjava-util</project> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> |
From: <joh...@co...> - 2004-02-18 06:21:20
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-hostaccess In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26548 Modified Files: project.xml Log Message: updated documentation in project.xml files, and added functionality to: Console: - provide convenient way to prompt the user for more information Config: - Provide snap-in container stacking, or scoping - Provide a JBoss service implementation of a snap-in container Probably other things, but I don't honestly remember everything... Index: project.xml =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-hostaccess/project.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- project.xml 15 Dec 2003 01:50:12 -0000 1.4 +++ project.xml 18 Feb 2004 06:12:00 -0000 1.5 @@ -3,7 +3,7 @@ <project> <pomVersion>3</pomVersion> <id>commonjava-hostaccess</id> - <name>CommonJava Host Access Control Library</name> + <name>Host Access</name> <groupId>commonjava</groupId> <currentVersion>2.1</currentVersion> <organization> @@ -13,6 +13,13 @@ <inceptionYear>2002</inceptionYear> <package>org.commonjava.hostaccess</package> + <description> + Contains a simple rule library and set of OPL parsers for specifying which hosts may access + an application remotely. Supported specifications are IP ranges, single IP addresses, and + CIDR-style network notations. These may be ANDed, ORed or NOTed to your heart's content, of + course. + </description> + <dependencies> <dependency> <groupId>commonjava</groupId> |
From: <joh...@co...> - 2004-02-18 06:21:06
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-cmdctl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26524 Modified Files: project.xml Log Message: updated documentation in project.xml files, and added functionality to: Console: - provide convenient way to prompt the user for more information Config: - Provide snap-in container stacking, or scoping - Provide a JBoss service implementation of a snap-in container Probably other things, but I don't honestly remember everything... Index: project.xml =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-cmdctl/project.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- project.xml 22 Sep 2003 19:30:44 -0000 1.1 +++ project.xml 18 Feb 2004 06:11:45 -0000 1.2 @@ -3,7 +3,7 @@ <project> <pomVersion>3</pomVersion> <id>commonjava-cmdctl</id> - <name>CommonJava Command and Control Libraries</name> + <name>Command & Control</name> <groupId>commonjava</groupId> <currentVersion>2.0</currentVersion> <organization> @@ -13,6 +13,16 @@ <inceptionYear>2002</inceptionYear> <package>org.commonjava.cmdctl</package> + <description> + Command & Control is a project intended to allow convenient control over the runtime environment. + Currently, the only implementation in this project is a task-oriented manager which is used as a + JVM shutdown hook. Essentially, the user only has to implement ShutdownTask (only the method + execute()), and then add an instance of this implementation to the ShutdownTaskManager via + ShutdownTaskManager.addTask(). On shutdown, the task manager is executed by the JVM, which triggers + a chain of events. First, the task manager locks itself, so that no new shutdown tasks may be added. + Then, it iterates through each task associated with it, executing each as it encounters it. + </description> + <dependencies> <dependency> <groupId>commons-logging</groupId> |
From: <joh...@co...> - 2004-02-18 06:20:58
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-diff In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26488 Modified Files: project.xml Log Message: updated documentation in project.xml files, and added functionality to: Console: - provide convenient way to prompt the user for more information Config: - Provide snap-in container stacking, or scoping - Provide a JBoss service implementation of a snap-in container Probably other things, but I don't honestly remember everything... Index: project.xml =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-diff/project.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- project.xml 22 Jan 2004 06:02:11 -0000 1.4 +++ project.xml 18 Feb 2004 06:11:37 -0000 1.5 @@ -3,7 +3,7 @@ <project> <pomVersion>3</pomVersion> <id>commonjava-diff</id> - <name>CommonJava Binary Diff Library</name> + <name>Binary Diff</name> <groupId>commonjava</groupId> <currentVersion>2.0-1</currentVersion> <organization> @@ -13,6 +13,18 @@ <inceptionYear>2002</inceptionYear> <package>org.commonjava.diff</package> + <description> + Binary Diff is CommonJava's implementation of the binary diff algorithm. It parses an inbound + ByteBuffer into a map of byte occurrences, and then finds the best chunk delimiter based on + minimum standard deviation and minimum average of the chunk length when divided by the candidate + chunk delimiter. Then, using this character, it chunks each ByteBuffer (original and new), and + proceeds much like any other diff algorithm. When a chunk is in the original but not the new, + that represents deleted information. When the chunk is in the new but not the original, that is + added information. These operations (adds and deletes) are then organized so that the engine can + reapply them to the new stream to retrieve the old stream. It could use some optimization, but + it works and we're pretty happy about that. + </description> + <dependencies> <dependency> <groupId>commonjava</groupId> |
Update of /cvsroot/commonjava/commonjava-projects/commonjava-config/src/java/org/commonjava/config/snapin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26323/src/java/org/commonjava/config/snapin Modified Files: SnapInContainerLoader.java GenericSnapInContainerLoader.java Added Files: StackedSnapInContainer.java Log Message: updated documentation in project.xml files, and added functionality to: Console: - provide convenient way to prompt the user for more information Config: - Provide snap-in container stacking, or scoping - Provide a JBoss service implementation of a snap-in container Probably other things, but I don't honestly remember everything... --- NEW FILE: StackedSnapInContainer.java --- /* Created on Jan 8, 2004 */ package org.commonjava.config.snapin; import java.util.Iterator; import java.util.LinkedList; /** * @author jdcasey */ public class StackedSnapInContainer implements SnapInContainer { private LinkedList containerStack = new LinkedList(); /** * */ public StackedSnapInContainer() { } public synchronized void prepend(SnapInContainer container){ containerStack.addFirst(container); } public synchronized void append(SnapInContainer container){ containerStack.addLast(container); } public synchronized void remove(SnapInContainer container){ containerStack.remove(container); } public synchronized ConfigSnapIn getSnapIn(String snapInId) { ConfigSnapIn snapIn = null; for (Iterator it = containerStack.iterator(); it.hasNext();) { SnapInContainer container = (SnapInContainer)it.next(); snapIn = (ConfigSnapIn)container.getSnapIn(snapInId); if(snapIn != null){ // Use the first snap-in matching this id. break; } } return snapIn; } public synchronized void addSnapIn(ConfigSnapIn snapIn) { SnapInContainer firstContainer = (SnapInContainer)containerStack.getFirst(); if(firstContainer == null){ firstContainer = new GenericSnapInContainer(); containerStack.addFirst(firstContainer); } firstContainer.addSnapIn(snapIn); } } Index: SnapInContainerLoader.java =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-config/src/java/org/commonjava/config/snapin/SnapInContainerLoader.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- SnapInContainerLoader.java 16 Jan 2004 02:20:26 -0000 1.2 +++ SnapInContainerLoader.java 18 Feb 2004 06:11:00 -0000 1.3 @@ -14,7 +14,7 @@ private static SnapInContainer container; - protected abstract SnapInContainer loadSnapInContainer() throws SnapInLoaderException; + public abstract SnapInContainer loadSnapInContainer() throws SnapInLoaderException; public static SnapInContainer getSnapInContainer() throws SnapInLoaderException{ synchronized(SnapInContainer.class){ Index: GenericSnapInContainerLoader.java =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-config/src/java/org/commonjava/config/snapin/GenericSnapInContainerLoader.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- GenericSnapInContainerLoader.java 16 Jan 2004 02:20:26 -0000 1.2 +++ GenericSnapInContainerLoader.java 18 Feb 2004 06:11:00 -0000 1.3 @@ -8,7 +8,7 @@ /** * @author jdcasey */ -final class GenericSnapInContainerLoader extends SnapInContainerLoader +public final class GenericSnapInContainerLoader extends SnapInContainerLoader { private static final String DEFAULT_LOCATION = "cprs:///configuration.xml"; @@ -21,11 +21,11 @@ { } - static SnapInContainerLoader getInstance(){ + public static SnapInContainerLoader getInstance(){ return INSTANCE; } - protected SnapInContainer loadSnapInContainer() throws SnapInLoaderException{ + public SnapInContainer loadSnapInContainer() throws SnapInLoaderException{ String location = System.getProperty(SnapInContainerLoader.LOCATION_SYSPROP, DEFAULT_LOCATION); try{ |
From: <joh...@co...> - 2004-02-18 06:20:24
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26323 Modified Files: .project .classpath project.xml project.properties Log Message: updated documentation in project.xml files, and added functionality to: Console: - provide convenient way to prompt the user for more information Config: - Provide snap-in container stacking, or scoping - Provide a JBoss service implementation of a snap-in container Probably other things, but I don't honestly remember everything... Index: .project =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-config/.project,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- .project 18 Sep 2003 00:42:46 -0000 1.1 +++ .project 18 Feb 2004 06:11:01 -0000 1.2 @@ -1,19 +1,24 @@ <?xml version="1.0" encoding="UTF-8"?> - <projectDescription> - <name>commonjava-config</name> - <comment> + <name>commonjava-config</name> + <comment> </comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> \ No newline at end of file + <projects> + <project>commonjava-codec</project> + <project>commonjava-io</project> + <project>commonjava-lang</project> + <project>commonjava-opl</project> + <project>commonjava-reflection</project> + <project>commonjava-util</project> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Index: .classpath =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-config/.classpath,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- .classpath 9 Jan 2004 05:05:14 -0000 1.4 +++ .classpath 18 Feb 2004 06:11:01 -0000 1.5 @@ -2,14 +2,17 @@ <classpath> <classpathentry kind="src" path="src/java"/> <classpathentry kind="var" path="JRE_LIB" sourcepath="JRE_SRC"/> - <classpathentry kind="var" path="MAVEN_REPO/commonjava/jars/commonjava-lang-2.0.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/commonjava/jars/commonjava-codec-2.0.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/commonjava/jars/commonjava-io-2.0.jar"/> - <classpathentry kind="var" - path="MAVEN_REPO/commonjava/jars/commonjava-reflection-2.0.jar" sourcepath="ECLIPSE_HOME/workspace/commonjava-reflection/src/java"/> <classpathentry kind="var" path="MAVEN_REPO/commons-logging/jars/commons-logging-1.0.2.jar"/> - <classpathentry kind="var" - path="MAVEN_REPO/commonjava/jars/commonjava-opl-2.1-4.jar" sourcepath="ECLIPSE_HOME/workspace/commonjava-opl/src/java"/> - <classpathentry kind="var" path="MAVEN_REPO/commonjava/jars/commonjava-util-2.0-2.jar"/> + <classpathentry kind="var" path="MAVEN_REPO/jboss/jars/jboss-system-3.2.3.jar"/> + <classpathentry kind="var" path="MAVEN_REPO/jboss/jars/jnp-client-3.2.3.jar"/> + <classpathentry kind="var" path="MAVEN_REPO/jboss/jars/jboss-jmx-3.2.3.jar"/> + <classpathentry kind="var" path="MAVEN_REPO/jboss/jars/jboss-common-3.2.3.jar"/> + <classpathentry kind="var" path="MAVEN_REPO/jboss/jars/jboss-3.2.3.jar"/> + <classpathentry kind="src" path="/commonjava-util"/> + <classpathentry kind="src" path="/commonjava-reflection"/> + <classpathentry kind="src" path="/commonjava-opl"/> + <classpathentry kind="src" path="/commonjava-lang"/> + <classpathentry kind="src" path="/commonjava-io"/> + <classpathentry kind="src" path="/commonjava-codec"/> <classpathentry kind="output" path="target/classes"/> </classpath> Index: project.xml =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-config/project.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- project.xml 9 Jan 2004 05:05:14 -0000 1.2 +++ project.xml 18 Feb 2004 06:11:01 -0000 1.3 @@ -3,9 +3,9 @@ <project> <pomVersion>3</pomVersion> <id>commonjava-config</id> - <name>CommonJava Configuration Objects</name> + <name>Configurations</name> <groupId>commonjava</groupId> - <currentVersion>2.1</currentVersion> + <currentVersion>2.1-1</currentVersion> <organization> <name>CommonJava Open Component Project</name> <url>http://www.commonjava.org</url> @@ -13,6 +13,30 @@ <inceptionYear>2002</inceptionYear> <package>org.commonjava.config</package> + <description> + The Configurations project is intended to provide various ways of configuring an application, + beyond mere properties files. These methods are mainly based on XML configuration files, although + one notable exception to this is the org.commonjava.config.Configuration class, which can have + any number of format/parse codecs for it. XML and properties file format are supported natively. + Beyond this, the next generation of configuration involves building and storing complex configuration + objects, which can then be referenced by an application via a common configuration repository. These + objects are called snap-ins, and are managed by the SnapInContainer/SnapInContainerLoader hierarchy, + in org.commonjava.config.snapin. The snap-in package was originally intended to be coupled with OPL + (another CommonJava project, for parsing XML into objects), but technically can be used with any + object parser. The SnapInContainerLoader implementation may drive the parsing process, as in the + case of GenericSnapInContainerLoader, but doesn't have to. The only requirement of the snap-in + functionality is that it serve as a commonly-accessible repository for configuration objects, + which are each keyed by a unique id String (usually the class name of the configuration object, + to avoid namespacing issues). Then, the application can use + SnapInContainerLoader.getSnapInContainer().getSnapIn(UID) to retrieve the configuration object + it desires. Paired with the namespace-awareness of OPL, the snap-in framework can support and + consolidate an incredible range of configuration information within easy reach of any application + component. No more passing configuration objects as parameters to level after level of nested + constructors. No more custom singletons serving configuration information in non-standard ways. + No more x.getIntegerProperty("some.unique.key"), paired with management of the unique keys via + constants class. This is better. Trust us. + </description> + <dependencies> <dependency> <groupId>commonjava</groupId> Index: project.properties =================================================================== RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-config/project.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- project.properties 18 Sep 2003 00:42:46 -0000 1.1 +++ project.properties 18 Feb 2004 06:11:01 -0000 1.2 @@ -3,3 +3,4 @@ maven.repo.central=www.commonjava.org maven.repo.central.directory=/usr/local/maven-repository +maven.multiproject.includes=projects/**/project.xml |
From: <joh...@co...> - 2004-02-18 06:20:24
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-config/projects/jboss-config-service/service-client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26323/projects/jboss-config-service/service-client Added Files: project.xml project.properties Log Message: updated documentation in project.xml files, and added functionality to: Console: - provide convenient way to prompt the user for more information Config: - Provide snap-in container stacking, or scoping - Provide a JBoss service implementation of a snap-in container Probably other things, but I don't honestly remember everything... --- NEW FILE: project.xml --- <?xml version="1.0" encoding="UTF-8"?> <project> <pomVersion>3</pomVersion> <id>commonjava-config-jboss-service-client</id> <name>CommonJava Configuration Objects - JBoss Service Client</name> <groupId>commonjava</groupId> <currentVersion>2.1</currentVersion> <organization> <name>CommonJava Open Component Project</name> <url>http://www.commonjava.org</url> </organization> <inceptionYear>2002</inceptionYear> <package>org.commonjava.config</package> <dependencies> <dependency> <groupId>commonjava</groupId> <artifactId>commonjava-enterprise-services</artifactId> <version>2.1-1</version> <url>http://www.commonjava.org</url> </dependency> <dependency> <groupId>commonjava</groupId> <artifactId>commonjava-config</artifactId> <version>2.1-1</version> <url>http://www.commonjava.org</url> </dependency> <dependency> <groupId>commonjava</groupId> <artifactId>commonjava-config-jndi</artifactId> <version>2.1-4</version> <url>http://www.commonjava.org</url> </dependency> <dependency> <groupId>jboss</groupId> <artifactId>jnp-client</artifactId> <version>3.2.3</version> </dependency> <dependency> <groupId>jboss</groupId> <artifactId>jboss-common</artifactId> <version>3.2.3</version> </dependency> <dependency> <groupId>jboss</groupId> <artifactId>jboss-system</artifactId> <version>3.2.3</version> </dependency> <dependency> <groupId>jboss</groupId> <artifactId>jboss-jmx</artifactId> <version>3.2.3</version> </dependency> <dependency> <groupId>commonjava</groupId> <artifactId>commonjava-lang</artifactId> <version>2.0</version> <url>http://www.commonjava.org</url> </dependency> <dependency> <groupId>commonjava</groupId> <artifactId>commonjava-opl</artifactId> <version>2.1-4</version> <url>http://www.commonjava.org</url> </dependency> <dependency> <groupId>commonjava</groupId> <artifactId>commonjava-io</artifactId> <version>2.0</version> <url>http://www.commonjava.org</url> </dependency> <dependency> <groupId>commonjava</groupId> <artifactId>commonjava-reflection</artifactId> <version>2.0</version> <url>http://www.commonjava.org</url> </dependency> <dependency> <groupId>commonjava</groupId> <artifactId>commonjava-util</artifactId> <version>2.0-2</version> <url>http://www.commonjava.org</url> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.0.2</version> <url>http://jakarta.apache.org/commons/logging.html</url> </dependency> </dependencies> <build> <sourceDirectory>${basedir}/../src/java</sourceDirectory> <sourceModifications> <sourceModification> <className>AlwaysPerformTheseModifications</className> <excludes> <exclude>**/JBossSnapInService.java</exclude> </excludes> </sourceModification> </sourceModifications> <unitTestSourceDirectory>${basedir}/../src/test</unitTestSourceDirectory> </build> </project> --- NEW FILE: project.properties --- maven.username=maven maven.repo.central=www.commonjava.org maven.repo.central.directory=/usr/local/maven-repository maven.jar.excludes=**/*Service.java |
From: <joh...@co...> - 2004-02-18 06:20:24
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-config/projects/jboss-config-service/src/java/org/commonjava/config/snapin/jboss In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26323/projects/jboss-config-service/src/java/org/commonjava/config/snapin/jboss Added Files: JBossSnapInLocalSvcLoader.java SnapInServiceMBean.java JBossSnapInService.java JBossSnapInServiceConstants.java JBossSnapInServiceLoader.java Log Message: updated documentation in project.xml files, and added functionality to: Console: - provide convenient way to prompt the user for more information Config: - Provide snap-in container stacking, or scoping - Provide a JBoss service implementation of a snap-in container Probably other things, but I don't honestly remember everything... --- NEW FILE: JBossSnapInLocalSvcLoader.java --- /* Created on Feb 14, 2004 */ package org.commonjava.config.snapin.jboss; import javax.naming.NamingException; import org.commonjava.config.snapin.SnapInContainer; import org.commonjava.config.snapin.SnapInContainerLoader; import org.commonjava.config.snapin.SnapInLoaderException; import org.commonjava.j2ee.services.ServiceLocator; import org.commonjava.j2ee.services.config.EnterpriseConfigurationException; /** * @author jdcasey */ public class JBossSnapInLocalSvcLoader extends SnapInContainerLoader { public JBossSnapInLocalSvcLoader(){} public SnapInContainer loadSnapInContainer() throws SnapInLoaderException { try { return (SnapInContainer)ServiceLocator.getLocalService( JBossSnapInServiceConstants.JNDI_NAME, SnapInContainer.class ); } catch(NamingException e){ throw new SnapInLoaderException(e); } catch (EnterpriseConfigurationException e) { throw new SnapInLoaderException(e); } } } --- NEW FILE: SnapInServiceMBean.java --- /* Created on Feb 17, 2004 */ package org.commonjava.config.snapin.jboss; import javax.management.ObjectName; import org.jboss.mx.util.ObjectNameFactory; import org.jboss.system.ServiceMBean; /** * @author jdcasey */ public interface SnapInServiceMBean extends ServiceMBean { //default object name public static final ObjectName OBJECT_NAME = ObjectNameFactory.create( "jboss:type=Service,service=SnapInService" ); } --- NEW FILE: JBossSnapInService.java --- /* Created on Feb 14, 2004 */ package org.commonjava.config.snapin.jboss; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.Name; import javax.naming.NameNotFoundException; import javax.naming.NamingException; import javax.naming.Reference; import javax.naming.StringRefAddr; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.commonjava.config.snapin.SnapInContainer; import org.commonjava.config.snapin.SnapInContainerLoader; import org.commonjava.config.snapin.SnapInLoaderException; import org.commonjava.opl.ParseException; import org.jboss.naming.NonSerializableFactory; import org.jboss.system.ServiceMBeanSupport; /** Service used to expose a snap-in container to the server via JNDI. * * @jmx:mbean name="jboss:type=Service,service=SnapInService" * extends="org.jboss.system.ServiceMBean" * * @author John Casey */ public final class JBossSnapInService extends ServiceMBeanSupport implements SnapInServiceMBean{ private static final Log LOG = LogFactory.getLog(JBossSnapInService.class); private SnapInContainer container; /* (non-Javadoc) * @see org.jboss.system.ServiceMBeanSupport#startService() */ protected void startService() throws Exception { bind(); } /* (non-Javadoc) * @see org.jboss.system.ServiceMBeanSupport#stopService() */ protected void stopService() throws Exception { unbind(); // release container. Reload if re-bound. container = null; } private void bind() throws NamingException, SnapInLoaderException, ParseException { ensureContainerLoaded(); String bindName = JBossSnapInServiceConstants.JNDI_NAME; NonSerializableFactory.bind(bindName, container); Context ctx = new InitialContext(); try{ Name n = ctx.getNameParser("").parse(bindName); while (n.size() > 1){ String ctxName = n.get(0); try{ ctx = (Context) ctx.lookup(ctxName); } catch (NameNotFoundException e){ ctx = ctx.createSubcontext(ctxName); } n = n.getSuffix(1); } // The helper class NonSerializableFactory uses address type nns, we go on to // use the helper class to bind the javax.mail.Session object in JNDI StringRefAddr addr = new StringRefAddr("nns", bindName); Reference ref = new Reference( SnapInContainer.class.getName(), addr, NonSerializableFactory.class.getName(), null ); ctx.bind(n.get(0), ref); } finally{ ctx.close(); } if (LOG.isInfoEnabled()) { LOG.info("Snap-In Service bound to " + bindName); } } private void unbind() throws NamingException, ParseException { String bindName = JBossSnapInServiceConstants.JNDI_NAME; if (bindName != null) { InitialContext ctx = new InitialContext(); try{ ctx.unbind(bindName); } finally{ ctx.close(); } NonSerializableFactory.unbind(bindName); if (LOG.isInfoEnabled()) { LOG.info("Snap-In service '" + bindName + "' removed from JNDI"); } } } /** * */ private void ensureContainerLoaded() throws SnapInLoaderException, ParseException { this.container = SnapInContainerLoader.getSnapInContainer(); } } --- NEW FILE: JBossSnapInServiceConstants.java --- /* Created on Feb 14, 2004 */ package org.commonjava.config.snapin.jboss; /** * @author jdcasey */ public final class JBossSnapInServiceConstants { public static final String JNDI_NAME = "/services/JBossSnapInService"; private JBossSnapInServiceConstants() { } } --- NEW FILE: JBossSnapInServiceLoader.java --- /* Created on Feb 14, 2004 */ package org.commonjava.config.snapin.jboss; import javax.naming.NamingException; import org.commonjava.config.snapin.GenericSnapInContainerLoader; import org.commonjava.config.snapin.SnapInContainer; import org.commonjava.config.snapin.SnapInContainerLoader; import org.commonjava.config.snapin.SnapInLoaderException; import org.commonjava.config.snapin.StackedSnapInContainer; import org.commonjava.j2ee.services.ServiceLocator; import org.commonjava.j2ee.services.config.EnterpriseConfigurationException; /** * @author jdcasey */ public class JBossSnapInServiceLoader extends SnapInContainerLoader { public JBossSnapInServiceLoader(){} public SnapInContainer loadSnapInContainer() throws SnapInLoaderException { // We're using a pretty complex setup here. We'll stack the local configuration on top of // the proxied one from the JNDI lookup. This way, local settings can override remote ones. StackedSnapInContainer container = new StackedSnapInContainer(); // First, load the local configuration snap-ins. SnapInContainerLoader localLoader = GenericSnapInContainerLoader.getInstance(); SnapInContainer localContainer = localLoader.loadSnapInContainer(); container.prepend(localContainer); try { SnapInContainer remoteContainer = (SnapInContainer)ServiceLocator.getService( JBossSnapInServiceConstants.JNDI_NAME, SnapInContainer.class ); container.append(remoteContainer); } catch (EnterpriseConfigurationException e) { throw new SnapInLoaderException(e); } catch(NamingException e){ throw new SnapInLoaderException(e); } return container; } } |
From: <joh...@co...> - 2004-02-18 06:20:24
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-config/projects/jboss-config-service/src/java/META-INF In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26323/projects/jboss-config-service/src/java/META-INF Added Files: jboss-service.xml Log Message: updated documentation in project.xml files, and added functionality to: Console: - provide convenient way to prompt the user for more information Config: - Provide snap-in container stacking, or scoping - Provide a JBoss service implementation of a snap-in container Probably other things, but I don't honestly remember everything... --- NEW FILE: jboss-service.xml --- <?xml version="1.0" encoding="UTF-8"?> <server> <mbean code="org.commonjava.config.snapin.jboss.JBossSnapInService" name="jboss:service=SnapInService"/> </server> |
From: <joh...@co...> - 2004-02-18 06:20:20
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-config/projects/jboss-config-service In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26323/projects/jboss-config-service Added Files: project.properties project.xml Log Message: updated documentation in project.xml files, and added functionality to: Console: - provide convenient way to prompt the user for more information Config: - Provide snap-in container stacking, or scoping - Provide a JBoss service implementation of a snap-in container Probably other things, but I don't honestly remember everything... --- NEW FILE: project.properties --- maven.username=maven maven.repo.central=www.commonjava.org maven.repo.central.directory=/usr/local/maven-repository --- NEW FILE: project.xml --- <?xml version="1.0" encoding="UTF-8"?> <project> <pomVersion>3</pomVersion> <id>commonjava-config-jboss-service</id> <name>CommonJava Configuration Objects JBoss Service</name> <groupId>commonjava</groupId> <currentVersion>2.1</currentVersion> <organization> <name>CommonJava Open Component Project</name> <url>http://www.commonjava.org</url> </organization> <inceptionYear>2002</inceptionYear> <package>org.commonjava.config</package> <dependencies> <dependency> <groupId>commonjava</groupId> <artifactId>commonjava-enterprise-services</artifactId> <version>2.1-1</version> <url>http://www.commonjava.org</url> </dependency> <dependency> <groupId>commonjava</groupId> <artifactId>commonjava-config</artifactId> <version>2.1-1</version> <url>http://www.commonjava.org</url> </dependency> <dependency> <groupId>jboss</groupId> <artifactId>jboss</artifactId> <version>3.2.3</version> </dependency> <dependency> <groupId>jboss</groupId> <artifactId>jboss-system</artifactId> <version>3.2.3</version> </dependency> <dependency> <groupId>jboss</groupId> <artifactId>jboss-common</artifactId> <version>3.2.3</version> </dependency> <dependency> <groupId>jboss</groupId> <artifactId>jboss-jmx</artifactId> <version>3.2.3</version> </dependency> <dependency> <groupId>jboss</groupId> <artifactId>jnpserver</artifactId> <version>3.2.3</version> </dependency> <dependency> <groupId>commonjava</groupId> <artifactId>commonjava-lang</artifactId> <version>2.0</version> <url>http://www.commonjava.org</url> </dependency> <dependency> <groupId>commonjava</groupId> <artifactId>commonjava-opl</artifactId> <version>2.1-4</version> <url>http://www.commonjava.org</url> </dependency> <dependency> <groupId>commonjava</groupId> <artifactId>commonjava-io</artifactId> <version>2.0</version> <url>http://www.commonjava.org</url> </dependency> <dependency> <groupId>commonjava</groupId> <artifactId>commonjava-reflection</artifactId> <version>2.0</version> <url>http://www.commonjava.org</url> </dependency> <dependency> <groupId>commonjava</groupId> <artifactId>commonjava-util</artifactId> <version>2.0-2</version> <url>http://www.commonjava.org</url> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.0.2</version> <url>http://jakarta.apache.org/commons/logging.html</url> </dependency> </dependencies> <build> <sourceDirectory>${basedir}/src/java</sourceDirectory> <sourceModifications> <sourceModification> <className>AlwaysPerformTheseModifications</className> <excludes> <exclude>**/JBossSnapInServiceLoader.java</exclude> </excludes> </sourceModification> </sourceModifications> <unitTestSourceDirectory>${basedir}/src/test</unitTestSourceDirectory> <unitTest> <resources> <resource> <directory>${basedir}/src/java</directory> <includes> <include>META-INF/**</include> </includes> </resource> </resources> </unitTest> <resources> <resource> <directory>${basedir}/src/java</directory> <includes> <include>META-INF/**</include> </includes> </resource> </resources> </build> </project> |
From: <joh...@co...> - 2004-02-18 06:19:49
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-config/projects/jboss-config-service/src/java/org/commonjava/config/snapin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26148/projects/jboss-config-service/src/java/org/commonjava/config/snapin Log Message: Directory /cvsroot/commonjava/commonjava-projects/commonjava-config/projects/jboss-config-service/src/java/org/commonjava/config/snapin added to the repository |
From: <joh...@co...> - 2004-02-18 06:19:49
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-config/projects/jboss-config-service/src/java/org/commonjava/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26148/projects/jboss-config-service/src/java/org/commonjava/config Log Message: Directory /cvsroot/commonjava/commonjava-projects/commonjava-config/projects/jboss-config-service/src/java/org/commonjava/config added to the repository |
From: <joh...@co...> - 2004-02-18 06:19:48
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-config/projects/jboss-config-service/src/java/org/commonjava In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26148/projects/jboss-config-service/src/java/org/commonjava Log Message: Directory /cvsroot/commonjava/commonjava-projects/commonjava-config/projects/jboss-config-service/src/java/org/commonjava added to the repository |
From: <joh...@co...> - 2004-02-18 06:19:48
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-config/projects/jboss-config-service/src/java In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26148/projects/jboss-config-service/src/java Log Message: Directory /cvsroot/commonjava/commonjava-projects/commonjava-config/projects/jboss-config-service/src/java added to the repository |
From: <joh...@co...> - 2004-02-18 06:19:48
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-config/projects/jboss-config-service/src/java/org/commonjava/config/snapin/jboss In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26148/projects/jboss-config-service/src/java/org/commonjava/config/snapin/jboss Log Message: Directory /cvsroot/commonjava/commonjava-projects/commonjava-config/projects/jboss-config-service/src/java/org/commonjava/config/snapin/jboss added to the repository |
From: <joh...@co...> - 2004-02-18 06:19:48
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-config/projects/jboss-config-service/src/java/org In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26148/projects/jboss-config-service/src/java/org Log Message: Directory /cvsroot/commonjava/commonjava-projects/commonjava-config/projects/jboss-config-service/src/java/org added to the repository |
From: <joh...@co...> - 2004-02-18 06:19:48
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-config/projects/jboss-config-service/src/java/META-INF In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26148/projects/jboss-config-service/src/java/META-INF Log Message: Directory /cvsroot/commonjava/commonjava-projects/commonjava-config/projects/jboss-config-service/src/java/META-INF added to the repository |
From: <joh...@co...> - 2004-02-18 06:19:48
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-config/projects/jboss-config-service In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26148/projects/jboss-config-service Log Message: Directory /cvsroot/commonjava/commonjava-projects/commonjava-config/projects/jboss-config-service added to the repository |
From: <joh...@co...> - 2004-02-18 06:19:48
|
Update of /cvsroot/commonjava/commonjava-projects/commonjava-config/projects/jboss-config-service/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26148/projects/jboss-config-service/src Log Message: Directory /cvsroot/commonjava/commonjava-projects/commonjava-config/projects/jboss-config-service/src added to the repository |