RE: [JBoss-dev] CVS update: jboss-common/src/main/org/jboss/net/protocol URLStreamHandlerFactory.java package.html

2002-02-25 Thread marc fleury

So where we had a simple System.setProperty(bla bla) we now have a
factory, a stream handler that doesn't work reliably, a couple of
Class.forName() in the code (that OF COURSE don't work with the custom
classloading) a lot of crazyness **we don't need**?

man, it makes me nervous I tell you, I will try to look at this tomorrow, it
better be good, simple and NECESSARY jason, I pray it is good.

marcf

|-Original Message-
|From: [EMAIL PROTECTED]
|[mailto:[EMAIL PROTECTED]]On Behalf Of Jason
|Dillon
|Sent: Monday, February 25, 2002 5:29 PM
|To: [EMAIL PROTECTED]
|Subject: [JBoss-dev] CVS update:
|jboss-common/src/main/org/jboss/net/protocol
|URLStreamHandlerFactory.java package.html
|
|
|  User: user57
|  Date: 02/02/25 17:28:37
|
|  Added:   src/main/org/jboss/net/protocol URLStreamHandlerFactory.java
|package.html
|  Log:
|   o Adding factory that will load handlers from org.jboss.net.protocol
| as it appears that the URL version won't work with our custom
|class loading
|
|  Revision  ChangesPath
|  1.1
|jboss-common/src/main/org/jboss/net/protocol/URLStreamHandlerFactory.java
|
|  Index: URLStreamHandlerFactory.java
|  ===
|  /***
|   * *
|   *  JBoss: The OpenSource J2EE WebOS   *
|   * *
|   *  Distributable under LGPL license.  *
|   *  See terms of license at gnu.org.   *
|   * *
|   ***/
|
|  package org.jboss.net.protocol;
|
|  import java.net.URLStreamHandler;
|
|  /**
|   * A factory for loading JBoss specific protocols.  This is based
|   * on Sun's URL mechanism, in that ttHandler/tt classes will be
|   * looked for in the ttorg.jboss.net.protocol/tt.
|   *
|   * pThis factory is installed by the default server implementaion
|   *as it appears that our custom class loading disallows the
|   *default URL logic to function when setting the
|   *ttjava.protocol.handler.pkgs/tt system property.
|   *
|   * @version tt$Revision: 1.1 $/tt
|   * @author  a href=mailto:[EMAIL PROTECTED];Jason Dillon/a
|   */
|  public class URLStreamHandlerFactory
| implements java.net.URLStreamHandlerFactory
|  {
| /** The package prefix where JBoss protocol handlers live. */
| public static final String PACKAGE_PREFIX = org.jboss.net.protocol;
|
| /**
|  * Returns the Stream Handler.
|  *
|  * @param protocolThe protocol to use
|  * @returnThe protocol handler or null if not found
|  */
| public URLStreamHandler createURLStreamHandler(final String protocol)
| {
|URLStreamHandler handler = null;
|
|try {
|   String classname = PACKAGE_PREFIX + . + protocol + .Handler;
|   Class type = null;
|
|   try {
|  type = Class.forName(classname);
|   }
|   catch (ClassNotFoundException e) {
|  ClassLoader cl = ClassLoader.getSystemClassLoader();
|  if (cl != null) {
| type = cl.loadClass(classname);
|  }
|   }
|
|   if (type != null) {
|  handler = (URLStreamHandler)type.newInstance();
|   }
|}
|catch (Exception ignore) {}
|
|return handler;
| }
|  }
|
|
|
|  1.1
|jboss-common/src/main/org/jboss/net/protocol/package.html
|
|  Index: package.html
|  ===
|  !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
|  html
|head
|  !-- $Id: package.html,v 1.1 2002/02/26 01:28:37 user57 Exp $ --
|  !--
|
|  JBoss: The OpenSource J2EE WebOS
|
|  Distributable under LGPL license.
|  See terms of license at gnu.org.
|
|  --
|/head
|
|body bgcolor=white
|  pURL protocol stream helpers.
|
|  h2Package Specification/h2
|  ul
|lia href=javascript: alert('not available')Not Available/a
|  /ul
|
|  h2Related Documentation/h2
|  ul
|lia href=javascript: alert('not available')Not Available/a
|  /ul
|
|  h2Package Status/h2
|  ul
|lifont color=greenbSTABLE/b/font
|  /ul
|
|  h2Todo/h2
|  ul
|li???
|  /ul
|
|  !-- Put @see and @since tags down here. --
|
|/body
|  /html
|
|
|
|
|___
|Jboss-development mailing list
|[EMAIL PROTECTED]
|https://lists.sourceforge.net/lists/listinfo/jboss-development


___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



RE: [JBoss-dev] CVS update: jboss-common/src/main/org/jboss/net/protocol URLStreamHandlerFactory.java package.html

2002-02-25 Thread marc fleury

what the *fuck* is a protocol handler,

please

marcf

|-Original Message-
|From: Jason Dillon [mailto:[EMAIL PROTECTED]]
|Sent: Monday, February 25, 2002 6:04 PM
|To: marc fleury
|Cc: Jason Dillon; [EMAIL PROTECTED]
|Subject: Re: [JBoss-dev] CVS update:
|jboss-common/src/main/org/jboss/net/protocol
|URLStreamHandlerFactory.java package.html
|
|
|Both setting the system property and installing a factory are both
|standard methods for introducing custom protocol handlers.
|
|I am not sure exactly why Class.forName() did not pick up the loaded
|classes.  If you can see why, please let me know, cause I don't get it.
|
|As for the handler, it looks like it works well... there was just a
|problem getting it to be used with out having to have MainDeployer
|explicity install a factory.
|
|The changes to ServerImpl will allow more custom protocols to be used
|without having to explictly install the factory (which could mess up
|other protocol usage... perhaps).
|
|I am concerned why Class.forName() didn't pull this up, so please have a
|look and drop some knowledge =)
|
|--jason
|
|
|marc fleury wrote:
|
|So where we had a simple System.setProperty(bla bla) we now have a
|factory, a stream handler that doesn't work reliably, a couple of
|Class.forName() in the code (that OF COURSE don't work with the custom
|classloading) a lot of crazyness **we don't need**?
|
|man, it makes me nervous I tell you, I will try to look at this
|tomorrow, it
|better be good, simple and NECESSARY jason, I pray it is good.
|
|marcf
|
||-Original Message-
||From: [EMAIL PROTECTED]
||[mailto:[EMAIL PROTECTED]]On Behalf Of Jason
||Dillon
||Sent: Monday, February 25, 2002 5:29 PM
||To: [EMAIL PROTECTED]
||Subject: [JBoss-dev] CVS update:
||jboss-common/src/main/org/jboss/net/protocol
||URLStreamHandlerFactory.java package.html
||
||
||  User: user57
||  Date: 02/02/25 17:28:37
||
||  Added:   src/main/org/jboss/net/protocol
|URLStreamHandlerFactory.java
||package.html
||  Log:
||   o Adding factory that will load handlers from org.jboss.net.protocol
|| as it appears that the URL version won't work with our custom
||class loading
||
||  Revision  ChangesPath
||  1.1
||jboss-common/src/main/org/jboss/net/protocol/URLStreamHandlerFactory.java
||
||  Index: URLStreamHandlerFactory.java
||  ===
||  /***
||   * *
||   *  JBoss: The OpenSource J2EE WebOS   *
||   * *
||   *  Distributable under LGPL license.  *
||   *  See terms of license at gnu.org.   *
||   * *
||   ***/
||
||  package org.jboss.net.protocol;
||
||  import java.net.URLStreamHandler;
||
||  /**
||   * A factory for loading JBoss specific protocols.  This is based
||   * on Sun's URL mechanism, in that ttHandler/tt classes will be
||   * looked for in the ttorg.jboss.net.protocol/tt.
||   *
||   * pThis factory is installed by the default server implementaion
||   *as it appears that our custom class loading disallows the
||   *default URL logic to function when setting the
||   *ttjava.protocol.handler.pkgs/tt system property.
||   *
||   * @version tt$Revision: 1.1 $/tt
||   * @author  a href=mailto:[EMAIL PROTECTED];Jason Dillon/a
||   */
||  public class URLStreamHandlerFactory
|| implements java.net.URLStreamHandlerFactory
||  {
|| /** The package prefix where JBoss protocol handlers live. */
|| public static final String PACKAGE_PREFIX =
|org.jboss.net.protocol;
||
|| /**
||  * Returns the Stream Handler.
||  *
||  * @param protocolThe protocol to use
||  * @returnThe protocol handler or null if not found
||  */
|| public URLStreamHandler createURLStreamHandler(final String
|protocol)
|| {
||URLStreamHandler handler = null;
||
||try {
||   String classname = PACKAGE_PREFIX + . + protocol +
|.Handler;
||   Class type = null;
||
||   try {
||  type = Class.forName(classname);
||   }
||   catch (ClassNotFoundException e) {
||  ClassLoader cl = ClassLoader.getSystemClassLoader();
||  if (cl != null) {
|| type = cl.loadClass(classname);
||  }
||   }
||
||   if (type != null) {
||  handler = (URLStreamHandler)type.newInstance();
||   }
||}
||catch (Exception ignore) {}
||
||return handler;
|| }
||  }
||
||
||
||  1.1
||jboss-common/src/main/org/jboss/net/protocol/package.html
||
||  Index: package.html
||  ===
||  !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
||  html
||head
||  !-- $Id: package.html,v 1.1 2002/02/26 01:28:37 user57 Exp

Re: [JBoss-dev] CVS update: jboss-common/src/main/org/jboss/net/protocol URLStreamHandlerFactory.java package.html

2002-02-25 Thread Jason Dillon

Both setting the system property and installing a factory are both 
standard methods for introducing custom protocol handlers.

I am not sure exactly why Class.forName() did not pick up the loaded 
classes.  If you can see why, please let me know, cause I don't get it.

As for the handler, it looks like it works well... there was just a 
problem getting it to be used with out having to have MainDeployer 
explicity install a factory.

The changes to ServerImpl will allow more custom protocols to be used 
without having to explictly install the factory (which could mess up 
other protocol usage... perhaps).

I am concerned why Class.forName() didn't pull this up, so please have a 
look and drop some knowledge =)

--jason


marc fleury wrote:

So where we had a simple System.setProperty(bla bla) we now have a
factory, a stream handler that doesn't work reliably, a couple of
Class.forName() in the code (that OF COURSE don't work with the custom
classloading) a lot of crazyness **we don't need**?

man, it makes me nervous I tell you, I will try to look at this tomorrow, it
better be good, simple and NECESSARY jason, I pray it is good.

marcf

|-Original Message-
|From: [EMAIL PROTECTED]
|[mailto:[EMAIL PROTECTED]]On Behalf Of Jason
|Dillon
|Sent: Monday, February 25, 2002 5:29 PM
|To: [EMAIL PROTECTED]
|Subject: [JBoss-dev] CVS update:
|jboss-common/src/main/org/jboss/net/protocol
|URLStreamHandlerFactory.java package.html
|
|
|  User: user57
|  Date: 02/02/25 17:28:37
|
|  Added:   src/main/org/jboss/net/protocol URLStreamHandlerFactory.java
|package.html
|  Log:
|   o Adding factory that will load handlers from org.jboss.net.protocol
| as it appears that the URL version won't work with our custom
|class loading
|
|  Revision  ChangesPath
|  1.1
|jboss-common/src/main/org/jboss/net/protocol/URLStreamHandlerFactory.java
|
|  Index: URLStreamHandlerFactory.java
|  ===
|  /***
|   * *
|   *  JBoss: The OpenSource J2EE WebOS   *
|   * *
|   *  Distributable under LGPL license.  *
|   *  See terms of license at gnu.org.   *
|   * *
|   ***/
|
|  package org.jboss.net.protocol;
|
|  import java.net.URLStreamHandler;
|
|  /**
|   * A factory for loading JBoss specific protocols.  This is based
|   * on Sun's URL mechanism, in that ttHandler/tt classes will be
|   * looked for in the ttorg.jboss.net.protocol/tt.
|   *
|   * pThis factory is installed by the default server implementaion
|   *as it appears that our custom class loading disallows the
|   *default URL logic to function when setting the
|   *ttjava.protocol.handler.pkgs/tt system property.
|   *
|   * @version tt$Revision: 1.1 $/tt
|   * @author  a href=mailto:[EMAIL PROTECTED];Jason Dillon/a
|   */
|  public class URLStreamHandlerFactory
| implements java.net.URLStreamHandlerFactory
|  {
| /** The package prefix where JBoss protocol handlers live. */
| public static final String PACKAGE_PREFIX = org.jboss.net.protocol;
|
| /**
|  * Returns the Stream Handler.
|  *
|  * @param protocolThe protocol to use
|  * @returnThe protocol handler or null if not found
|  */
| public URLStreamHandler createURLStreamHandler(final String protocol)
| {
|URLStreamHandler handler = null;
|
|try {
|   String classname = PACKAGE_PREFIX + . + protocol + .Handler;
|   Class type = null;
|
|   try {
|  type = Class.forName(classname);
|   }
|   catch (ClassNotFoundException e) {
|  ClassLoader cl = ClassLoader.getSystemClassLoader();
|  if (cl != null) {
| type = cl.loadClass(classname);
|  }
|   }
|
|   if (type != null) {
|  handler = (URLStreamHandler)type.newInstance();
|   }
|}
|catch (Exception ignore) {}
|
|return handler;
| }
|  }
|
|
|
|  1.1
|jboss-common/src/main/org/jboss/net/protocol/package.html
|
|  Index: package.html
|  ===
|  !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
|  html
|head
|  !-- $Id: package.html,v 1.1 2002/02/26 01:28:37 user57 Exp $ --
|  !--
|
|  JBoss: The OpenSource J2EE WebOS
|
|  Distributable under LGPL license.
|  See terms of license at gnu.org.
|
|  --
|/head
|
|body bgcolor=white
|  pURL protocol stream helpers.
|
|  h2Package Specification/h2
|  ul
|lia href=javascript: alert('not available')Not Available/a
|  /ul
|
|  h2Related Documentation/h2
|  ul
|lia href=javascript: alert('not available')Not Available/a
|  /ul
|
|  h2Package 

RE: [JBoss-dev] CVS update: jboss-common/src/main/org/jboss/net/protocol URLStreamHandlerFactory.java package.html

2002-02-25 Thread marc fleury

ok here is an excercise for you

What are you trying to achieve in the embedding (LESS THAN 57 words)

I am serious about the 57 words limit, I don't want a mental diarreah email,
I want this is what I am trying to do.  It is an excercise the french go
through when they are young (and I was never really good at it).

Bonus if you can fit in these 57 words the and this is how I do it

go!

marcf

|-Original Message-
|From: Jason Dillon [mailto:[EMAIL PROTECTED]]
|Sent: Monday, February 25, 2002 6:04 PM
|To: marc fleury
|Cc: Jason Dillon; [EMAIL PROTECTED]
|Subject: Re: [JBoss-dev] CVS update:
|jboss-common/src/main/org/jboss/net/protocol
|URLStreamHandlerFactory.java package.html
|
|
|Both setting the system property and installing a factory are both
|standard methods for introducing custom protocol handlers.
|
|I am not sure exactly why Class.forName() did not pick up the loaded
|classes.  If you can see why, please let me know, cause I don't get it.
|
|As for the handler, it looks like it works well... there was just a
|problem getting it to be used with out having to have MainDeployer
|explicity install a factory.
|
|The changes to ServerImpl will allow more custom protocols to be used
|without having to explictly install the factory (which could mess up
|other protocol usage... perhaps).
|
|I am concerned why Class.forName() didn't pull this up, so please have a
|look and drop some knowledge =)
|
|--jason
|
|
|marc fleury wrote:
|
|So where we had a simple System.setProperty(bla bla) we now have a
|factory, a stream handler that doesn't work reliably, a couple of
|Class.forName() in the code (that OF COURSE don't work with the custom
|classloading) a lot of crazyness **we don't need**?
|
|man, it makes me nervous I tell you, I will try to look at this
|tomorrow, it
|better be good, simple and NECESSARY jason, I pray it is good.
|
|marcf
|
||-Original Message-
||From: [EMAIL PROTECTED]
||[mailto:[EMAIL PROTECTED]]On Behalf Of Jason
||Dillon
||Sent: Monday, February 25, 2002 5:29 PM
||To: [EMAIL PROTECTED]
||Subject: [JBoss-dev] CVS update:
||jboss-common/src/main/org/jboss/net/protocol
||URLStreamHandlerFactory.java package.html
||
||
||  User: user57
||  Date: 02/02/25 17:28:37
||
||  Added:   src/main/org/jboss/net/protocol
|URLStreamHandlerFactory.java
||package.html
||  Log:
||   o Adding factory that will load handlers from org.jboss.net.protocol
|| as it appears that the URL version won't work with our custom
||class loading
||
||  Revision  ChangesPath
||  1.1
||jboss-common/src/main/org/jboss/net/protocol/URLStreamHandlerFactory.java
||
||  Index: URLStreamHandlerFactory.java
||  ===
||  /***
||   * *
||   *  JBoss: The OpenSource J2EE WebOS   *
||   * *
||   *  Distributable under LGPL license.  *
||   *  See terms of license at gnu.org.   *
||   * *
||   ***/
||
||  package org.jboss.net.protocol;
||
||  import java.net.URLStreamHandler;
||
||  /**
||   * A factory for loading JBoss specific protocols.  This is based
||   * on Sun's URL mechanism, in that ttHandler/tt classes will be
||   * looked for in the ttorg.jboss.net.protocol/tt.
||   *
||   * pThis factory is installed by the default server implementaion
||   *as it appears that our custom class loading disallows the
||   *default URL logic to function when setting the
||   *ttjava.protocol.handler.pkgs/tt system property.
||   *
||   * @version tt$Revision: 1.1 $/tt
||   * @author  a href=mailto:[EMAIL PROTECTED];Jason Dillon/a
||   */
||  public class URLStreamHandlerFactory
|| implements java.net.URLStreamHandlerFactory
||  {
|| /** The package prefix where JBoss protocol handlers live. */
|| public static final String PACKAGE_PREFIX =
|org.jboss.net.protocol;
||
|| /**
||  * Returns the Stream Handler.
||  *
||  * @param protocolThe protocol to use
||  * @returnThe protocol handler or null if not found
||  */
|| public URLStreamHandler createURLStreamHandler(final String
|protocol)
|| {
||URLStreamHandler handler = null;
||
||try {
||   String classname = PACKAGE_PREFIX + . + protocol +
|.Handler;
||   Class type = null;
||
||   try {
||  type = Class.forName(classname);
||   }
||   catch (ClassNotFoundException e) {
||  ClassLoader cl = ClassLoader.getSystemClassLoader();
||  if (cl != null) {
|| type = cl.loadClass(classname);
||  }
||   }
||
||   if (type != null) {
||  handler = (URLStreamHandler)type.newInstance();
||   }
||}
||catch (Exception ignore) {}
||
||return handler

Re: [JBoss-dev] CVS update: jboss-common/src/main/org/jboss/net/protocol URLStreamHandlerFactory.java package.html

2002-02-25 Thread Jason Dillon

Read this:

http://java.sun.com/j2se/1.4/docs/api/java/net/URL.html#URL(java.lang.String, 
java.lang.String, int, java.lang.String)

--jason


marc fleury wrote:

what the *fuck* is a protocol handler,

please

marcf

|-Original Message-
|From: Jason Dillon [mailto:[EMAIL PROTECTED]]
|Sent: Monday, February 25, 2002 6:04 PM
|To: marc fleury
|Cc: Jason Dillon; [EMAIL PROTECTED]
|Subject: Re: [JBoss-dev] CVS update:
|jboss-common/src/main/org/jboss/net/protocol
|URLStreamHandlerFactory.java package.html
|
|
|Both setting the system property and installing a factory are both
|standard methods for introducing custom protocol handlers.
|
|I am not sure exactly why Class.forName() did not pick up the loaded
|classes.  If you can see why, please let me know, cause I don't get it.
|
|As for the handler, it looks like it works well... there was just a
|problem getting it to be used with out having to have MainDeployer
|explicity install a factory.
|
|The changes to ServerImpl will allow more custom protocols to be used
|without having to explictly install the factory (which could mess up
|other protocol usage... perhaps).
|
|I am concerned why Class.forName() didn't pull this up, so please have a
|look and drop some knowledge =)
|
|--jason
|
|
|marc fleury wrote:
|
|So where we had a simple System.setProperty(bla bla) we now have a
|factory, a stream handler that doesn't work reliably, a couple of
|Class.forName() in the code (that OF COURSE don't work with the custom
|classloading) a lot of crazyness **we don't need**?
|
|man, it makes me nervous I tell you, I will try to look at this
|tomorrow, it
|better be good, simple and NECESSARY jason, I pray it is good.
|
|marcf
|
||-Original Message-
||From: [EMAIL PROTECTED]
||[mailto:[EMAIL PROTECTED]]On Behalf Of Jason
||Dillon
||Sent: Monday, February 25, 2002 5:29 PM
||To: [EMAIL PROTECTED]
||Subject: [JBoss-dev] CVS update:
||jboss-common/src/main/org/jboss/net/protocol
||URLStreamHandlerFactory.java package.html
||
||
||  User: user57
||  Date: 02/02/25 17:28:37
||
||  Added:   src/main/org/jboss/net/protocol
|URLStreamHandlerFactory.java
||package.html
||  Log:
||   o Adding factory that will load handlers from org.jboss.net.protocol
|| as it appears that the URL version won't work with our custom
||class loading
||
||  Revision  ChangesPath
||  1.1
||jboss-common/src/main/org/jboss/net/protocol/URLStreamHandlerFactory.java
||
||  Index: URLStreamHandlerFactory.java
||  ===
||  /***
||   * *
||   *  JBoss: The OpenSource J2EE WebOS   *
||   * *
||   *  Distributable under LGPL license.  *
||   *  See terms of license at gnu.org.   *
||   * *
||   ***/
||
||  package org.jboss.net.protocol;
||
||  import java.net.URLStreamHandler;
||
||  /**
||   * A factory for loading JBoss specific protocols.  This is based
||   * on Sun's URL mechanism, in that ttHandler/tt classes will be
||   * looked for in the ttorg.jboss.net.protocol/tt.
||   *
||   * pThis factory is installed by the default server implementaion
||   *as it appears that our custom class loading disallows the
||   *default URL logic to function when setting the
||   *ttjava.protocol.handler.pkgs/tt system property.
||   *
||   * @version tt$Revision: 1.1 $/tt
||   * @author  a href=mailto:[EMAIL PROTECTED];Jason Dillon/a
||   */
||  public class URLStreamHandlerFactory
|| implements java.net.URLStreamHandlerFactory
||  {
|| /** The package prefix where JBoss protocol handlers live. */
|| public static final String PACKAGE_PREFIX =
|org.jboss.net.protocol;
||
|| /**
||  * Returns the Stream Handler.
||  *
||  * @param protocolThe protocol to use
||  * @returnThe protocol handler or null if not found
||  */
|| public URLStreamHandler createURLStreamHandler(final String
|protocol)
|| {
||URLStreamHandler handler = null;
||
||try {
||   String classname = PACKAGE_PREFIX + . + protocol +
|.Handler;
||   Class type = null;
||
||   try {
||  type = Class.forName(classname);
||   }
||   catch (ClassNotFoundException e) {
||  ClassLoader cl = ClassLoader.getSystemClassLoader();
||  if (cl != null) {
|| type = cl.loadClass(classname);
||  }
||   }
||
||   if (type != null) {
||  handler = (URLStreamHandler)type.newInstance();
||   }
||}
||catch (Exception ignore) {}
||
||return handler;
|| }
||  }
||
||
||
||  1.1
||jboss-common/src/main/org/jboss/net/protocol/package.html
||
||  Index: package.html

RE: [JBoss-dev] CVS update: jboss-common/src/main/org/jboss/net/protocol URLStreamHandlerFactory.java package.html

2002-02-25 Thread marc fleury

And you explain in those 57 words why you need one in the embedding world

marcf

|-Original Message-
|From: [EMAIL PROTECTED]
|[mailto:[EMAIL PROTECTED]]On Behalf Of Jason
|Dillon
|Sent: Monday, February 25, 2002 6:10 PM
|To: marc fleury
|Cc: Jason Dillon; [EMAIL PROTECTED]
|Subject: Re: [JBoss-dev] CVS update:
|jboss-common/src/main/org/jboss/net/protocol
|URLStreamHandlerFactory.java package.html
|
|
|Read this:
|
|http://java.sun.com/j2se/1.4/docs/api/java/net/URL.html#URL(java.la
|ng.String,
|java.lang.String, int, java.lang.String)
|
|--jason
|
|
|marc fleury wrote:
|
|what the *fuck* is a protocol handler,
|
|please
|
|marcf
|
||-Original Message-
||From: Jason Dillon [mailto:[EMAIL PROTECTED]]
||Sent: Monday, February 25, 2002 6:04 PM
||To: marc fleury
||Cc: Jason Dillon; [EMAIL PROTECTED]
||Subject: Re: [JBoss-dev] CVS update:
||jboss-common/src/main/org/jboss/net/protocol
||URLStreamHandlerFactory.java package.html
||
||
||Both setting the system property and installing a factory are both
||standard methods for introducing custom protocol handlers.
||
||I am not sure exactly why Class.forName() did not pick up the loaded
||classes.  If you can see why, please let me know, cause I don't get it.
||
||As for the handler, it looks like it works well... there was just a
||problem getting it to be used with out having to have MainDeployer
||explicity install a factory.
||
||The changes to ServerImpl will allow more custom protocols to be used
||without having to explictly install the factory (which could mess up
||other protocol usage... perhaps).
||
||I am concerned why Class.forName() didn't pull this up, so please have a
||look and drop some knowledge =)
||
||--jason
||
||
||marc fleury wrote:
||
||So where we had a simple System.setProperty(bla bla) we now have a
||factory, a stream handler that doesn't work reliably, a couple of
||Class.forName() in the code (that OF COURSE don't work with the custom
||classloading) a lot of crazyness **we don't need**?
||
||man, it makes me nervous I tell you, I will try to look at this
||tomorrow, it
||better be good, simple and NECESSARY jason, I pray it is good.
||
||marcf
||
|||-Original Message-
|||From: [EMAIL PROTECTED]
|||[mailto:[EMAIL PROTECTED]]On
|Behalf Of Jason
|||Dillon
|||Sent: Monday, February 25, 2002 5:29 PM
|||To: [EMAIL PROTECTED]
|||Subject: [JBoss-dev] CVS update:
|||jboss-common/src/main/org/jboss/net/protocol
|||URLStreamHandlerFactory.java package.html
|||
|||
|||  User: user57
|||  Date: 02/02/25 17:28:37
|||
|||  Added:   src/main/org/jboss/net/protocol
||URLStreamHandlerFactory.java
|||package.html
|||  Log:
|||   o Adding factory that will load handlers from org.jboss.net.protocol
||| as it appears that the URL version won't work with our custom
|||class loading
|||
|||  Revision  ChangesPath
|||  1.1
|||jboss-common/src/main/org/jboss/net/protocol/URLStreamHandlerFa
|ctory.java
|||
|||  Index: URLStreamHandlerFactory.java
|||  ===
|||  /***
|||   * *
|||   *  JBoss: The OpenSource J2EE WebOS   *
|||   * *
|||   *  Distributable under LGPL license.  *
|||   *  See terms of license at gnu.org.   *
|||   * *
|||   ***/
|||
|||  package org.jboss.net.protocol;
|||
|||  import java.net.URLStreamHandler;
|||
|||  /**
|||   * A factory for loading JBoss specific protocols.  This is based
|||   * on Sun's URL mechanism, in that ttHandler/tt classes will be
|||   * looked for in the ttorg.jboss.net.protocol/tt.
|||   *
|||   * pThis factory is installed by the default server implementaion
|||   *as it appears that our custom class loading disallows the
|||   *default URL logic to function when setting the
|||   *ttjava.protocol.handler.pkgs/tt system property.
|||   *
|||   * @version tt$Revision: 1.1 $/tt
|||   * @author  a href=mailto:[EMAIL PROTECTED];Jason Dillon/a
|||   */
|||  public class URLStreamHandlerFactory
||| implements java.net.URLStreamHandlerFactory
|||  {
||| /** The package prefix where JBoss protocol handlers live. */
||| public static final String PACKAGE_PREFIX =
||org.jboss.net.protocol;
|||
||| /**
|||  * Returns the Stream Handler.
|||  *
|||  * @param protocolThe protocol to use
|||  * @returnThe protocol handler or null if not found
|||  */
||| public URLStreamHandler createURLStreamHandler(final String
||protocol)
||| {
|||URLStreamHandler handler = null;
|||
|||try {
|||   String classname = PACKAGE_PREFIX + . + protocol +
||.Handler;
|||   Class type = null;
|||
|||   try {
|||  type = Class.forName(classname);
|||   }
|||   catch (ClassNotFoundException e

Re: [JBoss-dev] CVS update: jboss-common/src/main/org/jboss/net/protocol URLStreamHandlerFactory.java package.html

2002-02-25 Thread Jason Dillon

This has nothing todo with embedding.  It simplifies usage of such 
handlers which may be used inside the system.  Since ServerImpl is where 
the base gets initialized it seems logical that such init should be done 
here.

Why the objection?  I don't understand your motives here.  57 words 
coming along...

--jason


marc fleury wrote:

And you explain in those 57 words why you need one in the embedding world

marcf

|-Original Message-
|From: [EMAIL PROTECTED]
|[mailto:[EMAIL PROTECTED]]On Behalf Of Jason
|Dillon
|Sent: Monday, February 25, 2002 6:10 PM
|To: marc fleury
|Cc: Jason Dillon; [EMAIL PROTECTED]
|Subject: Re: [JBoss-dev] CVS update:
|jboss-common/src/main/org/jboss/net/protocol
|URLStreamHandlerFactory.java package.html
|
|
|Read this:
|
|http://java.sun.com/j2se/1.4/docs/api/java/net/URL.html#URL(java.la
|ng.String,
|java.lang.String, int, java.lang.String)
|
|--jason
|
|
|marc fleury wrote:
|
|what the *fuck* is a protocol handler,
|
|please
|
|marcf
|
||-Original Message-
||From: Jason Dillon [mailto:[EMAIL PROTECTED]]
||Sent: Monday, February 25, 2002 6:04 PM
||To: marc fleury
||Cc: Jason Dillon; [EMAIL PROTECTED]
||Subject: Re: [JBoss-dev] CVS update:
||jboss-common/src/main/org/jboss/net/protocol
||URLStreamHandlerFactory.java package.html
||
||
||Both setting the system property and installing a factory are both
||standard methods for introducing custom protocol handlers.
||
||I am not sure exactly why Class.forName() did not pick up the loaded
||classes.  If you can see why, please let me know, cause I don't get it.
||
||As for the handler, it looks like it works well... there was just a
||problem getting it to be used with out having to have MainDeployer
||explicity install a factory.
||
||The changes to ServerImpl will allow more custom protocols to be used
||without having to explictly install the factory (which could mess up
||other protocol usage... perhaps).
||
||I am concerned why Class.forName() didn't pull this up, so please have a
||look and drop some knowledge =)
||
||--jason
||
||
||marc fleury wrote:
||
||So where we had a simple System.setProperty(bla bla) we now have a
||factory, a stream handler that doesn't work reliably, a couple of
||Class.forName() in the code (that OF COURSE don't work with the custom
||classloading) a lot of crazyness **we don't need**?
||
||man, it makes me nervous I tell you, I will try to look at this
||tomorrow, it
||better be good, simple and NECESSARY jason, I pray it is good.
||
||marcf
||
|||-Original Message-
|||From: [EMAIL PROTECTED]
|||[mailto:[EMAIL PROTECTED]]On
|Behalf Of Jason
|||Dillon
|||Sent: Monday, February 25, 2002 5:29 PM
|||To: [EMAIL PROTECTED]
|||Subject: [JBoss-dev] CVS update:
|||jboss-common/src/main/org/jboss/net/protocol
|||URLStreamHandlerFactory.java package.html
|||
|||
|||  User: user57
|||  Date: 02/02/25 17:28:37
|||
|||  Added:   src/main/org/jboss/net/protocol
||URLStreamHandlerFactory.java
|||package.html
|||  Log:
|||   o Adding factory that will load handlers from org.jboss.net.protocol
||| as it appears that the URL version won't work with our custom
|||class loading
|||
|||  Revision  ChangesPath
|||  1.1
|||jboss-common/src/main/org/jboss/net/protocol/URLStreamHandlerFa
|ctory.java
|||
|||  Index: URLStreamHandlerFactory.java
|||  ===
|||  /***
|||   * *
|||   *  JBoss: The OpenSource J2EE WebOS   *
|||   * *
|||   *  Distributable under LGPL license.  *
|||   *  See terms of license at gnu.org.   *
|||   * *
|||   ***/
|||
|||  package org.jboss.net.protocol;
|||
|||  import java.net.URLStreamHandler;
|||
|||  /**
|||   * A factory for loading JBoss specific protocols.  This is based
|||   * on Sun's URL mechanism, in that ttHandler/tt classes will be
|||   * looked for in the ttorg.jboss.net.protocol/tt.
|||   *
|||   * pThis factory is installed by the default server implementaion
|||   *as it appears that our custom class loading disallows the
|||   *default URL logic to function when setting the
|||   *ttjava.protocol.handler.pkgs/tt system property.
|||   *
|||   * @version tt$Revision: 1.1 $/tt
|||   * @author  a href=mailto:[EMAIL PROTECTED];Jason Dillon/a
|||   */
|||  public class URLStreamHandlerFactory
||| implements java.net.URLStreamHandlerFactory
|||  {
||| /** The package prefix where JBoss protocol handlers live. */
||| public static final String PACKAGE_PREFIX =
||org.jboss.net.protocol;
|||
||| /**
|||  * Returns the Stream Handler.
|||  *
|||  * @param protocolThe protocol to use
|||  * @returnThe protocol handler or null if not found
|||  */
||| public URLStreamHandler createURLStreamHandler(final String
||protocol