}
if (conv != null) {
try {
- conv.convert(bc, cc, cc.getBuffer().length - cc.getEnd());
+ conv.convert(bc, cc);
uri.setChars(cc.getBuffer(), cc.getStart(),
cc.getLength());
return;
/**
* Replace ${NAME} with the property value
+ *
+ * @deprecated Use the explicit method
+ */
+ public static String replaceProperties(String value, Object getter) {
+ if (getter instanceof Hashtable)
+ return replaceProperties(value, (Hashtable) getter, null);
+
+ if (getter instanceof PropertySource) {
+ PropertySource src[] = new PropertySource[] { (PropertySource) getter };
+ return replaceProperties(value, null, src);
+ }
+ return value;
+ }
+
+ /**
+ * Replace ${NAME} with the property value
*/
- public static String replaceProperties(String value,
- Hashtable<Object,Object> staticProp, PropertySource dynamicProp[]) {
+ public static String replaceProperties(String value, Hashtable staticProp,
+ PropertySource dynamicProp[]) {
if (value.indexOf("$") < 0) {
return value;
}
static final int BUFFER_SIZE=8192;
char result[]=new char[BUFFER_SIZE];
+ /** Convert a buffer of bytes into a chars
+ * @deprecated
+ */
+ public void convert( ByteChunk bb, CharChunk cb )
+ throws IOException
+ {
+ // Set the ByteChunk as input to the Intermediate reader
+ convert(bb, cb, cb.getBuffer().length - cb.getEnd());
+ }
+
public void convert( ByteChunk bb, CharChunk cb, int limit)
throws IOException
/**
* Creates a new, uninitialized MessageBytes object.
- * Use static newInstance() in order to allow
+ * @deprecated Use static newInstance() in order to allow
* future hooks.
*/
- private MessageBytes() {
+ public MessageBytes() {
}
/** Construct a new MessageBytes instance
* in the order originally registered through the <code>add()</code>
* method.
*
+ * @param pattern Nesting pattern to be matched
+ *
+ * @deprecated Call match(namespaceURI,pattern) instead.
+ */
+ public List<Rule> match(String pattern) {
+ return match(namespaceURI, pattern);
+ }
+
+
+ /**
+ * Return a List of all registered Rule instances that match the specified
+ * nesting pattern, or a zero-length List if there are no matches. If more
+ * than one Rule instance matches, they <strong>must</strong> be returned
+ * in the order originally registered through the <code>add()</code>
+ * method.
+ *
* @param namespaceURI Namespace URI for which to select matching rules,
* or <code>null</code> to match regardless of namespace URI
* @param pattern Nesting pattern to be matched
* Construct a "call method" rule with the specified method name. The
* parameter types (if any) default to java.lang.String.
*
+ * @param digester The associated Digester
+ * @param methodName Method name of the parent method to call
+ * @param paramCount The number of parameters to collect, or
+ * zero for a single argument from the body of this element.
+ *
+ *
+ * @deprecated The digester instance is now set in the {@link Digester#addRule} method.
+ * Use {@link #CallMethodRule(String methodName,int paramCount)} instead.
+ */
+ public CallMethodRule(Digester digester, String methodName,
+ int paramCount) {
+
+ this(methodName, paramCount);
+
+ }
+
+
+ /**
+ * Construct a "call method" rule with the specified method name.
+ *
+ * @param digester The associated Digester
+ * @param methodName Method name of the parent method to call
+ * @param paramCount The number of parameters to collect, or
+ * zero for a single argument from the body of ths element
+ * @param paramTypes The Java class names of the arguments
+ * (if you wish to use a primitive type, specify the corresonding
+ * Java wrapper class instead, such as <code>java.lang.Boolean</code>
+ * for a <code>boolean</code> parameter)
+ *
+ * @deprecated The digester instance is now set in the {@link Digester#addRule} method.
+ * Use {@link #CallMethodRule(String methodName,int paramCount, String [] paramTypes)} instead.
+ */
+ public CallMethodRule(Digester digester, String methodName,
+ int paramCount, String paramTypes[]) {
+
+ this(methodName, paramCount, paramTypes);
+
+ }
+
+
+ /**
+ * Construct a "call method" rule with the specified method name.
+ *
+ * @param digester The associated Digester
+ * @param methodName Method name of the parent method to call
+ * @param paramCount The number of parameters to collect, or
+ * zero for a single argument from the body of ths element
+ * @param paramTypes The Java classes that represent the
+ * parameter types of the method arguments
+ * (if you wish to use a primitive type, specify the corresonding
+ * Java wrapper class instead, such as <code>java.lang.Boolean.TYPE</code>
+ * for a <code>boolean</code> parameter)
+ *
+ * @deprecated The digester instance is now set in the {@link Digester#addRule} method.
+ * Use {@link #CallMethodRule(String methodName,int paramCount, Class [] paramTypes)} instead.
+ */
+ public CallMethodRule(Digester digester, String methodName,
+ int paramCount, Class<?> paramTypes[]) {
+
+ this(methodName, paramCount, paramTypes);
+ }
+
+
+ /**
+ * Construct a "call method" rule with the specified method name. The
+ * parameter types (if any) default to java.lang.String.
+ *
* @param methodName Method name of the parent method to call
* @param paramCount The number of parameters to collect, or
* zero for a single argument from the body of this element.
* Construct a "call parameter" rule that will save the body text of this
* element as the parameter value.
*
+ * @param digester The associated Digester
+ * @param paramIndex The zero-relative parameter number
+ *
+ * @deprecated The digester instance is now set in the {@link Digester#addRule} method.
+ * Use {@link #CallParamRule(int paramIndex)} instead.
+ */
+ public CallParamRule(Digester digester, int paramIndex) {
+
+ this(paramIndex);
+
+ }
+
+
+ /**
+ * Construct a "call parameter" rule that will save the value of the
+ * specified attribute as the parameter value.
+ *
+ * @param digester The associated Digester
+ * @param paramIndex The zero-relative parameter number
+ * @param attributeName The name of the attribute to save
+ *
+ * @deprecated The digester instance is now set in the {@link Digester#addRule} method.
+ * Use {@link #CallParamRule(int paramIndex, String attributeName)} instead.
+ */
+ public CallParamRule(Digester digester, int paramIndex,
+ String attributeName) {
+
+ this(paramIndex, attributeName);
+
+ }
+
+ /**
+ * Construct a "call parameter" rule that will save the body text of this
+ * element as the parameter value.
+ *
* @param paramIndex The zero-relative parameter number
*/
public CallParamRule(int paramIndex) {
protected SAXParserFactory factory = null;
/**
+ * @deprecated This is now managed by {@link ParserFeatureSetterFactory}
+ */
+ protected String JAXP_SCHEMA_LANGUAGE =
+ "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+
+
+ /**
* The Locator associated with our parser.
*/
protected Locator locator = null;
/**
+ * Return the debugging detail level of our currently enabled logger.
+ *
+ * @deprecated This method now always returns 0. Digester uses the apache
+ * jakarta commons-logging library; see the documentation for that library
+ * for more information.
+ */
+ public int getDebug() {
+
+ return (0);
+
+ }
+
+
+ /**
+ * Set the debugging detail level of our currently enabled logger.
+ *
+ * @param debug New debugging detail level (0=off, increasing integers
+ * for more detail)
+ *
+ * @deprecated This method now has no effect at all. Digester uses
+ * the apache jakarta comons-logging library; see the documentation
+ * for that library for more information.
+ */
+ public void setDebug(int debug) {
+
+ ; // No action is taken
+
+ }
+
+
+ /**
* Return the error handler for this Digester.
*/
public ErrorHandler getErrorHandler() {
/**
+ * By setting the reader in the constructor, you can bypass JAXP and
+ * be able to use digester in Weblogic 6.0.
+ *
+ * @deprecated Use getXMLReader() instead, which can throw a
+ * SAXException if the reader cannot be instantiated
+ */
+ public XMLReader getReader() {
+
+ try {
+ return (getXMLReader());
+ } catch (SAXException e) {
+ log.error("Cannot get XMLReader", e);
+ return (null);
+ }
+
+ }
+
+
+ /**
* Return the <code>Rules</code> implementation object containing our
* rules collection and associated matching policy. If none has been
* established, a default implementation will be created and returned.
/**
+ * Log a message to our associated logger.
+ *
+ * @param message The message to be logged
+ * @deprecated Call getLogger() and use it's logging methods
+ */
+ public void log(String message) {
+
+ log.info(message);
+
+ }
+
+
+ /**
+ * Log a message and exception to our associated logger.
+ *
+ * @param message The message to be logged
+ * @deprecated Call getLogger() and use it's logging methods
+ */
+ public void log(String message, Throwable exception) {
+
+ log.error(message, exception);
+
+ }
+
+
+ /**
* Parse the content of the specified file using this Digester. Returns
* the root element from the object stack (if any).
*
/**
+ * Return the set of rules that apply to the specified match position.
+ * The selected rules are those that match exactly, or those rules
+ * that specify a suffix match and the tail of the rule matches the
+ * current match position. Exact matches have precedence over
+ * suffix matches, then (among suffix matches) the longest match
+ * is preferred.
+ *
+ * @param match The current match position
+ *
+ * @deprecated Call <code>match()</code> on the <code>Rules</code>
+ * implementation returned by <code>getRules()</code>
+ */
+ List<Rule> getRules(String match) {
+
+ return (getRules().match(match));
+
+ }
+
+
+ /**
* <p>Return the top object on the parameters stack without removing it. If there are
* no objects on the stack, return <code>null</code>.</p>
*
/**
+ * Construct a factory create rule that will use the specified
+ * class name to create an {@link ObjectCreationFactory} which will
+ * then be used to create an object and push it on the stack.
+ *
+ * @param digester The associated Digester
+ * @param className Java class name of the object creation factory class
+ *
+ * @deprecated The digester instance is now set in the {@link Digester#addRule} method.
+ * Use {@link #FactoryCreateRule(String className)} instead.
+ */
+ public FactoryCreateRule(Digester digester, String className) {
+
+ this(className);
+
+ }
+
+
+ /**
+ * Construct a factory create rule that will use the specified
+ * class to create an {@link ObjectCreationFactory} which will
+ * then be used to create an object and push it on the stack.
+ *
+ * @param digester The associated Digester
+ * @param clazz Java class name of the object creation factory class
+ *
+ * @deprecated The digester instance is now set in the {@link Digester#addRule} method.
+ * Use {@link #FactoryCreateRule(Class clazz)} instead.
+ */
+ public FactoryCreateRule(Digester digester, Class<?> clazz) {
+
+ this(clazz);
+
+ }
+
+
+ /**
+ * Construct a factory create rule that will use the specified
+ * class name (possibly overridden by the specified attribute if present)
+ * to create an {@link ObjectCreationFactory}, which will then be used
+ * to instantiate an object instance and push it onto the stack.
+ *
+ * @param digester The associated Digester
+ * @param className Default Java class name of the factory class
+ * @param attributeName Attribute name which, if present, contains an
+ * override of the class name of the object creation factory to create.
+ *
+ * @deprecated The digester instance is now set in the {@link Digester#addRule} method.
+ * Use {@link #FactoryCreateRule(String className, String attributeName)} instead.
+ */
+ public FactoryCreateRule(Digester digester,
+ String className, String attributeName) {
+
+ this(className, attributeName);
+
+ }
+
+
+ /**
+ * Construct a factory create rule that will use the specified
+ * class (possibly overridden by the specified attribute if present)
+ * to create an {@link ObjectCreationFactory}, which will then be used
+ * to instantiate an object instance and push it onto the stack.
+ *
+ * @param digester The associated Digester
+ * @param clazz Default Java class name of the factory class
+ * @param attributeName Attribute name which, if present, contains an
+ * override of the class name of the object creation factory to create.
+ *
+ * @deprecated The digester instance is now set in the {@link Digester#addRule} method.
+ * Use {@link #FactoryCreateRule(Class clazz, String attributeName)} instead.
+ */
+ public FactoryCreateRule(Digester digester,
+ Class<?> clazz, String attributeName) {
+
+ this(clazz, attributeName);
+
+ }
+
+
+ /**
+ * Construct a factory create rule using the given, already instantiated,
+ * {@link ObjectCreationFactory}.
+ *
+ * @param digester The associated Digester
+ * @param creationFactory called on to create the object.
+ *
+ * @deprecated The digester instance is now set in the {@link Digester#addRule} method.
+ * Use {@link #FactoryCreateRule(ObjectCreationFactory creationFactory)} instead.
+ */
+ public FactoryCreateRule(Digester digester,
+ ObjectCreationFactory creationFactory) {
+
+ this(creationFactory);
+
+ }
+
+ /**
* <p>Construct a factory create rule that will use the specified
* class name to create an {@link ObjectCreationFactory} which will
* then be used to create an object and push it on the stack.</p>
/**
* Construct an object create rule with the specified class name.
*
+ * @param digester The associated Digester
+ * @param className Java class name of the object to be created
+ *
+ * @deprecated The digester instance is now set in the {@link Digester#addRule} method.
+ * Use {@link #ObjectCreateRule(String className)} instead.
+ */
+ public ObjectCreateRule(Digester digester, String className) {
+
+ this(className);
+
+ }
+
+
+ /**
+ * Construct an object create rule with the specified class.
+ *
+ * @param digester The associated Digester
+ * @param clazz Java class name of the object to be created
+ *
+ * @deprecated The digester instance is now set in the {@link Digester#addRule} method.
+ * Use {@link #ObjectCreateRule(Class clazz)} instead.
+ */
+ public ObjectCreateRule(Digester digester, Class<?> clazz) {
+
+ this(clazz);
+
+ }
+
+
+ /**
+ * Construct an object create rule with the specified class name and an
+ * optional attribute name containing an override.
+ *
+ * @param digester The associated Digester
+ * @param className Java class name of the object to be created
+ * @param attributeName Attribute name which, if present, contains an
+ * override of the class name to create
+ *
+ * @deprecated The digester instance is now set in the {@link Digester#addRule} method.
+ * Use {@link #ObjectCreateRule(String className, String attributeName)} instead.
+ */
+ public ObjectCreateRule(Digester digester, String className,
+ String attributeName) {
+
+ this (className, attributeName);
+
+ }
+
+
+ /**
+ * Construct an object create rule with the specified class and an
+ * optional attribute name containing an override.
+ *
+ * @param digester The associated Digester
+ * @param attributeName Attribute name which, if present, contains an
+ * @param clazz Java class name of the object to be created
+ * override of the class name to create
+ *
+ * @deprecated The digester instance is now set in the {@link Digester#addRule} method.
+ * Use {@link #ObjectCreateRule(String attributeName, Class clazz)} instead.
+ */
+ public ObjectCreateRule(Digester digester,
+ String attributeName,
+ Class<?> clazz) {
+
+ this(attributeName, clazz);
+
+ }
+
+ /**
+ * Construct an object create rule with the specified class name.
+ *
* @param className Java class name of the object to be created
*/
public ObjectCreateRule(String className) {
/**
+ * Constructor sets the associated Digester.
+ *
+ * @param digester The digester with which this rule is associated
+ * @deprecated The digester instance is now set in the {@link Digester#addRule} method. Use {@link #Rule()} instead.
+ */
+ public Rule(Digester digester) {
+
+ super();
+ setDigester(digester);
+
+ }
+
+ /**
* <p>Base constructor.
* Now the digester will be set when the rule is added.</p>
*/
/**
* This method is called when the beginning of a matching XML element
+ * is encountered.
+ *
+ * @param attributes The attribute list of this element
+ * @deprecated Use the {@link #begin(String,String,Attributes) begin}
+ * method with <code>namespace</code> and <code>name</code>
+ * parameters instead.
+ */
+ public void begin(Attributes attributes) throws Exception {
+
+ ; // The default implementation does nothing
+
+ }
+
+
+ /**
+ * This method is called when the beginning of a matching XML element
* is encountered. The default implementation delegates to the deprecated
* method {@link #begin(Attributes) begin} without the
* <code>namespace</code> and <code>name</code> parameters, to retain
public void begin(String namespace, String name, Attributes attributes)
throws Exception {
- // The default implementation does nothing
+ begin(attributes);
+
+ }
+
+
+ /**
+ * This method is called when the body of a matching XML element
+ * is encountered. If the element has no body, this method is
+ * not called at all.
+ *
+ * @param text The text of the body of this element
+ * @deprecated Use the {@link #body(String,String,String) body} method
+ * with <code>namespace</code> and <code>name</code> parameters
+ * instead.
+ */
+ public void body(String text) throws Exception {
+
+ ; // The default implementation does nothing
}
public void body(String namespace, String name, String text)
throws Exception {
- // The default implementation does nothing
+ body(text);
+
+ }
+
+
+ /**
+ * This method is called when the end of a matching XML element
+ * is encountered.
+ *
+ * @deprecated Use the {@link #end(String,String) end} method with
+ * <code>namespace</code> and <code>name</code> parameters instead.
+ */
+ public void end() throws Exception {
+
+ ; // The default implementation does nothing
}
public void end(String namespace, String name)
throws Exception {
- // The default implementation does nothing
+ end();
}
* in the order originally registered through the <code>add()</code>
* method.
*
+ * @param pattern Nesting pattern to be matched
+ *
+ * @deprecated Call match(namespaceURI,pattern) instead.
+ */
+ public List<Rule> match(String pattern);
+
+
+ /**
+ * Return a List of all registered Rule instances that match the specified
+ * nesting pattern, or a zero-length List if there are no matches. If more
+ * than one Rule instance matches, they <strong>must</strong> be returned
+ * in the order originally registered through the <code>add()</code>
+ * method.
+ *
* @param namespaceURI Namespace URI for which to select matching rules,
* or <code>null</code> to match regardless of namespace URI
* @param pattern Nesting pattern to be matched
* in the order originally registered through the <code>add()</code>
* method.
*
+ * @param pattern Nesting pattern to be matched
+ *
+ * @deprecated Call match(namespaceURI,pattern) instead.
+ */
+ public List<Rule> match(String pattern) {
+
+ return (match(null, pattern));
+
+ }
+
+
+ /**
+ * Return a List of all registered Rule instances that match the specified
+ * nesting pattern, or a zero-length List if there are no matches. If more
+ * than one Rule instance matches, they <strong>must</strong> be returned
+ * in the order originally registered through the <code>add()</code>
+ * method.
+ *
* @param namespaceURI Namespace URI for which to select matching rules,
* or <code>null</code> to match regardless of namespace URI
* @param pattern Nesting pattern to be matched
* method's argument type is assumed to be the class of the
* child object.
*
+ * @param digester The associated Digester
+ * @param methodName Method name of the parent method to call
+ *
+ * @deprecated The digester instance is now set in the {@link Digester#addRule} method.
+ * Use {@link #SetNextRule(String methodName)} instead.
+ */
+ public SetNextRule(Digester digester, String methodName) {
+
+ this(methodName);
+
+ }
+
+
+ /**
+ * Construct a "set next" rule with the specified method name.
+ *
+ * @param digester The associated Digester
+ * @param methodName Method name of the parent method to call
+ * @param paramType Java class of the parent method's argument
+ * (if you wish to use a primitive type, specify the corresonding
+ * Java wrapper class instead, such as <code>java.lang.Boolean</code>
+ * for a <code>boolean</code> parameter)
+ *
+ * @deprecated The digester instance is now set in the {@link Digester#addRule} method.
+ * Use {@link #SetNextRule(String methodName,String paramType)} instead.
+ */
+ public SetNextRule(Digester digester, String methodName,
+ String paramType) {
+
+ this(methodName, paramType);
+
+ }
+
+ /**
+ * Construct a "set next" rule with the specified method name. The
+ * method's argument type is assumed to be the class of the
+ * child object.
+ *
* @param methodName Method name of the parent method to call
*/
public SetNextRule(String methodName) {
/**
+ * Default constructor sets only the the associated Digester.
+ *
+ * @param digester The digester with which this rule is associated
+ *
+ * @deprecated The digester instance is now set in the {@link Digester#addRule} method.
+ * Use {@link #SetPropertiesRule()} instead.
+ */
+ public SetPropertiesRule(Digester digester) {
+
+ this();
+
+ }
+
+
+ /**
* Base constructor.
*/
public SetPropertiesRule() {
* Construct a "set property" rule with the specified name and value
* attributes.
*
+ * @param digester The digester with which this rule is associated
+ * @param name Name of the attribute that will contain the name of the
+ * property to be set
+ * @param value Name of the attribute that will contain the value to which
+ * the property should be set
+ *
+ * @deprecated The digester instance is now set in the {@link Digester#addRule} method.
+ * Use {@link #SetPropertyRule(String name, String value)} instead.
+ */
+ public SetPropertyRule(Digester digester, String name, String value) {
+
+ this(name, value);
+
+ }
+
+ /**
+ * Construct a "set property" rule with the specified name and value
+ * attributes.
+ *
* @param name Name of the attribute that will contain the name of the
* property to be set
* @param value Name of the attribute that will contain the value to which
* method's argument type is assumed to be the class of the
* child object.
*
+ * @param digester The associated Digester
+ * @param methodName Method name of the parent method to call
+ *
+ * @deprecated The digester instance is now set in the {@link Digester#addRule} method.
+ * Use {@link #SetRootRule(String methodName)} instead.
+ */
+ public SetRootRule(Digester digester, String methodName) {
+
+ this(methodName);
+
+ }
+
+
+ /**
+ * Construct a "set root" rule with the specified method name.
+ *
+ * @param digester The associated Digester
+ * @param methodName Method name of the parent method to call
+ * @param paramType Java class of the parent method's argument
+ * (if you wish to use a primitive type, specify the corresonding
+ * Java wrapper class instead, such as <code>java.lang.Boolean</code>
+ * for a <code>boolean</code> parameter)
+ *
+ * @deprecated The digester instance is now set in the {@link Digester#addRule} method.
+ * Use {@link #SetRootRule(String methodName,String paramType)} instead.
+ */
+ public SetRootRule(Digester digester, String methodName,
+ String paramType) {
+
+ this(methodName, paramType);
+
+ }
+
+ /**
+ * Construct a "set root" rule with the specified method name. The
+ * method's argument type is assumed to be the class of the
+ * child object.
+ *
* @param methodName Method name of the parent method to call
*/
public SetRootRule(String methodName) {
* "set parent" method's argument type is assumed to be the class of the
* parent object.
*
+ * @param digester The associated Digester
+ * @param methodName Method name of the "set parent" method to call
+ *
+ * @deprecated The digester instance is now set in the {@link Digester#addRule} method.
+ * Use {@link #SetTopRule(String methodName)} instead.
+ */
+ public SetTopRule(Digester digester, String methodName) {
+
+ this(methodName);
+
+ }
+
+
+ /**
+ * Construct a "set parent" rule with the specified method name.
+ *
+ * @param digester The associated Digester
+ * @param methodName Method name of the "set parent" method to call
+ * @param paramType Java class of the "set parent" method's argument
+ * (if you wish to use a primitive type, specify the corresonding
+ * Java wrapper class instead, such as <code>java.lang.Boolean</code>
+ * for a <code>boolean</code> parameter)
+ *
+ * @deprecated The digester instance is now set in the {@link Digester#addRule} method.
+ * Use {@link #SetTopRule(String methodName, String paramType)} instead.
+ */
+ public SetTopRule(Digester digester, String methodName,
+ String paramType) {
+
+ this(methodName, paramType);
+
+ }
+
+ /**
+ * Construct a "set parent" rule with the specified method name. The
+ * "set parent" method's argument type is assumed to be the class of the
+ * parent object.
+ *
* @param methodName Method name of the "set parent" method to call
*/
public SetTopRule(String methodName) {
return true;
}
+ /**
+ * @deprecated - Not used
+ */
+ public static boolean checkName( String name ) {
+ if (!isToken(name)
+ || name.equalsIgnoreCase("Comment") // rfc2019
+ || name.equalsIgnoreCase("Discard") // rfc2965
+ || name.equalsIgnoreCase("Domain") // rfc2019
+ || name.equalsIgnoreCase("Expires") // Netscape
+ || name.equalsIgnoreCase("Max-Age") // rfc2019
+ || name.equalsIgnoreCase("Path") // rfc2019
+ || name.equalsIgnoreCase("Secure") // rfc2019
+ || name.equalsIgnoreCase("Version") // rfc2019
+ // TODO remaining RFC2965 attributes
+ ) {
+ return false;
+ }
+ return true;
+ }
+
// -------------------- Cookie parsing tools
headerBuf.append(buf);
}
+ /**
+ * @deprecated - Not used
+ */
+ @Deprecated
+ public static void maybeQuote (int version, StringBuffer buf,String value) {
+ // special case - a \n or \r shouldn't happen in any case
+ if (isToken(value)) {
+ buf.append(value);
+ } else {
+ buf.append('"');
+ buf.append(escapeDoubleQuotes(value,0,value.length()));
+ buf.append('"');
+ }
+ }
+
public static boolean alreadyQuoted (String value) {
if (value==null || value.length()==0) return false;
return (value.charAt(0)=='\"' && value.charAt(value.length()-1)=='\"');
private synchronized void registerNotifications( FixedNotificationFilter filter ) {
String names[]=filter.getNames();
- Registry reg=Registry.getRegistry(null, null);
+ Registry reg=Registry.getRegistry();
for( int i=0; i<names.length; i++ ) {
int code=reg.getId(null, names[i]);
if( hooks.length < code ) {
descriptorsByClass.remove( bean.getType());
}
+ // -------------------- Deprecated 1.0 methods --------------------
+
+ /**
+ * Factory method to create (if necessary) and return our
+ * <code>MBeanServer</code> instance.
+ *
+ * @since 1.0
+ * @deprecated Use the instance method
+ */
+ public static MBeanServer getServer() {
+ return Registry.getRegistry().getMBeanServer();
+ }
+
+ /**
+ * Set the <code>MBeanServer</code> to be utilized for our
+ * registered management beans.
+ *
+ * @param mbeanServer The new <code>MBeanServer</code> instance
+ * @since 1.0
+ * @deprecated Use the instance method
+ */
+ public static void setServer(MBeanServer mbeanServer) {
+ Registry.getRegistry().setMBeanServer(mbeanServer);
+ }
+
+ /**
+ * Load the registry from the XML input found in the specified input
+ * stream.
+ *
+ * @param stream InputStream containing the registry configuration
+ * information
+ *
+ * @exception Exception if any parsing or processing error occurs
+ * @deprecated use normal class method instead
+ * @since 1.0
+ */
+ public static void loadRegistry(InputStream stream) throws Exception {
+ Registry registry = getRegistry();
+ registry.loadMetadata(stream);
+ }
+
+ /** Get a "singelton" registry, or one per thread if setUseContextLoader
+ * was called
+ *
+ * @deprecated Not enough info - use the method that takes CL and domain
+ * @since 1.0
+ */
+ public synchronized static Registry getRegistry() {
+ return getRegistry(null, null);
+ }
+
// -------------------- Helpers --------------------
/** Get the type of an attribute of the object, from the metadata.
return;
}
- /**
+ /**Experimental. Will become private, some code may still use it
+ *
* @param sourceType
* @param source
* @param param
* @throws Exception
+ * @deprecated
*/
- private void loadDescriptors(String sourceType, Object source, String param)
+ public void loadDescriptors(String sourceType, Object source, String param)
throws Exception {
load(sourceType, source, param);
}
public void resetMetadata() {
stop();
}
-
/**
* Load the registry from the XML input found in the specified input
* stream.
loadDescriptors("MbeansDescriptorsDigesterSource", source, null );
}
+ /** @deprecated - may still be used in code using pre-1.1 builds
+ */
+ public void registerComponent(Object bean, String domain, String type,
+ String name)
+ throws Exception
+ {
+ StringBuffer sb=new StringBuffer();
+ sb.append( domain ).append(":");
+ sb.append( name );
+ String nameStr=sb.toString();
+ ObjectName oname=new ObjectName( nameStr );
+ registerComponent(bean, oname, type );
+ }
+
+
+
// should be removed
public void unregisterComponent( String domain, String name ) {
try {
}
}
+
+ /**
+ * Load the registry from a cached .ser file. This is typically 2-3 times
+ * faster than parsing the XML.
+ *
+ * @param source Source to be used to load. Can be an InputStream or URL.
+ *
+ * @exception Exception if any parsing or processing error occurs
+ * @deprecated Loaded automatically or using a File or Url ending in .ser
+ */
+ public void loadCachedDescriptors( Object source )
+ throws Exception
+ {
+ loadDescriptors("MbeansDescriptorsSerSource", source, null );
+ }
}
}
public void execute() throws Exception {
- if( registry==null ) registry=Registry.getRegistry(null, null);
+ if( registry==null ) registry=Registry.getRegistry();
try {
InputStream stream=(InputStream)source;
}
public void execute() throws Exception {
- if( registry==null ) registry=Registry.getRegistry(null, null);
+ if( registry==null ) registry=Registry.getRegistry();
try {
ManagedBean managed = createManagedBean(registry, null,
(Class<?>)source, type);
}
public void execute() throws Exception {
- if( registry==null ) registry=Registry.getRegistry(null, null);
+ if( registry==null ) registry=Registry.getRegistry();
long t1=System.currentTimeMillis();
try {
InputStream stream=null;
public void init() throws Exception {
if( mbeans==null) execute();
- if( registry==null ) registry=Registry.getRegistry(null, null);
+ if( registry==null ) registry=Registry.getRegistry();
registry.invoke(mbeans, "init", false);
}
}
public void execute() throws Exception {
- if( registry==null ) registry=Registry.getRegistry(null, null);
+ if( registry==null ) registry=Registry.getRegistry();
try {
InputStream stream=getInputStream();
long t1=System.currentTimeMillis();
firstMbeanN=descriptorsN;
}
- MBeanServer server =
- Registry.getRegistry(null, null).getMBeanServer();
+ MBeanServer server = Registry.getServer();
// XXX Not very clean... Just a workaround
if( ! loaderLoaded ) {
*/
public interface TcpConnectionHandler {
+ /** Add informations about the a "controler" object
+ * specific to the server. In tomcat it will be a
+ * ContextManager.
+ * @deprecated This has nothing to do with TcpHandling,
+ * was used as a workaround
+ */
+ public void setServer(Object manager);
+
+
+ /** Used to pass config informations to the handler.
+ *
+ * @deprecated This has nothing to do with Tcp,
+ * was used as a workaround.
+ */
+ public void setAttribute(String name, Object value );
+
/** Called before the call to processConnection.
* If the thread is reused, init() should be called once per thread.
*
currentThreadCount = toOpen;
}
+ /** @deprecated */
+ void log( String s ) {
+ log.info(s);
+ //loghelper.flush();
+ }
+
/**
* Periodically execute an action - cleanup in this case
*/