Return-Path: Delivered-To: apmail-felix-users-archive@locus.apache.org Received: (qmail 10270 invoked from network); 8 Oct 2008 14:07:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Oct 2008 14:07:51 -0000 Received: (qmail 79525 invoked by uid 500); 8 Oct 2008 14:07:49 -0000 Delivered-To: apmail-felix-users-archive@felix.apache.org Received: (qmail 79491 invoked by uid 500); 8 Oct 2008 14:07:49 -0000 Mailing-List: contact users-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@felix.apache.org Delivered-To: mailing list users@felix.apache.org Received: (qmail 79480 invoked by uid 99); 8 Oct 2008 14:07:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Oct 2008 07:07:49 -0700 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=DNS_FROM_SECURITYSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of karlpauls@gmail.com designates 74.125.92.149 as permitted sender) Received: from [74.125.92.149] (HELO qw-out-1920.google.com) (74.125.92.149) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Oct 2008 14:06:44 +0000 Received: by qw-out-1920.google.com with SMTP id 5so952022qwc.16 for ; Wed, 08 Oct 2008 07:07:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=YzriXZhxAedAF2J92rZiTVreeXdGJwoZoIHmyh7oJvg=; b=wSjh53sWdFDY2QcxRcOSgwkk4SH+IKknprjaVaPvnotoxKMYfeb8WdOdv914OAXn7H nIvsKLAuV64vjeUOS+Em4mshuWLjo0oVs01tSZlnBgmsTWVS1MAvGuOpNytXRS3wvxpa PPnuIUF4KMqL7WCJHSzCCyygtjkjFVxbgASxA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=MA7UIuU2vfXrPICp1+lhc/PfP/migKhL5rh6Ck7oPXoBlmswkzslsi3GttahHhal+Z 6UE0+bIgcUr92oD2AnAEL9Gh8Q338zZOljLSBw5JtCCE6joUTb1SC1uubo2cT82CSSD9 20xqmSrGNQrRnc6WqUSJfDSJubNI/k7IucoKg= Received: by 10.214.149.6 with SMTP id w6mr10394173qad.40.1223474822477; Wed, 08 Oct 2008 07:07:02 -0700 (PDT) Received: by 10.214.79.20 with HTTP; Wed, 8 Oct 2008 07:07:02 -0700 (PDT) Message-ID: <487a994c0810080707x5f76d966o293e740c4f21f381@mail.gmail.com> Date: Wed, 8 Oct 2008 16:07:02 +0200 From: "Karl Pauls" To: users@felix.apache.org Subject: Re: {Disarmed} Re: URLStreamHandler service In-Reply-To: <48ECAC7A.9090605@alcatel-lucent.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48ECA022.7000505@alcatel-lucent.fr> <487a994c0810080519p671f490dw8481cd1eb2d2ff0b@mail.gmail.com> <48ECAC7A.9090605@alcatel-lucent.fr> X-Virus-Checked: Checked by ClamAV on apache.org Ok. Well, from my interpretation of the spec, this isn't possible using an URLStreamHandler because of the build-in handlers being preferred (and for good reasons). However, it does sound to me like you have control over the jvm so what you can do is put your handler on the classpath (assuming it is in a package called http and is called Handler) and start with -Djava.protocol.handler.pkgs=your.pkg.prefix e.g., assuming I have a http handler called org.foo.http.Handler it would have to look like this: java -Djava.protocol.handler.pkgs=org.foo -jar bin/felix.jar and the org.pauls.http.Handler.class need to be available on the classpath. Hope this helps? regards, Karl On Wed, Oct 8, 2008 at 2:50 PM, Pierre De Rop wrote: > Hi Karl, > > We are running our A5350 cluster application server on top of OSGi. Our > server is made up of the following processes: > > * Protocol load balancers (http/sip/diameter etc ...) > * Felix Jvm frameworks. > > The load balancers dispatch all messages among Jmvs frameworks. > In each framework we start the following bundles: > > * A container for each protocol (http container/sip container, etc ...) > * applications (WARs, Diameter applications, Sip applications, etc ...) > > Now, in the case of the http container, we wan't to take the control, when > WARs > are using the java.net.HttpURLConnection: We just want to forward the http > request to our load balancer (using our own socket multiplexer), instead of > letting the jdk http client open itself a socket to the web servers > directly. > > With KnopflerFish, I used the OSGi URLStreamHandler service in order to do > that trick. > > Thanks > /pierre > > > > Karl Pauls wrote: >> >> You are trying to override a build-in handler. The http schema is >> handled by the jvm and must not be overridden (see 11.3.2 of the >> spec). >> >> Could you explain your use-case a bit more (why do you want to use >> your own http implementation?) - maybe we can find a workaround .... >> >> regards, >> >> Karl >> >> On Wed, Oct 8, 2008 at 1:57 PM, Pierre De Rop >> wrote: >> >>> >>> Hello everyone, >>> >>> I have a bundle which provides a >>> org.osgi.service.url.URLStreamHandlerService with protocol "http" and >>> "https". >>> but, when I use java.net.HttpURLConnection, my handlers are not invoked. >>> >>> I use SCR in order to provide my stream handlers. Here is he SCR.xml: >>> >>> >>> ------------------------------------------------------------------------------------------------------------------------ >>> >>> >> class="com.nextenso.http.agent.impl.HttpUrlStreamHandlerService"/> >>> >>> >>> >>> >>> http >>> https >>> >>> >>> >>> ------------------------------------------------------------------------------------------------------------------------- >>> >>> In the Felix configuration properties, I have set the property >>> "felix.service.urlhandlers=true" >>> But it sounds like my http/https handlers are not invoked by the >>> framework >>> when I >>> do the following: >>> >>> HttpURLConnection uc = (HttpURLConnection) new >>> URL("http://www.verisign.com/").openConnection(); >>> >>> -> could anyone help about this problem ? >>> >>> (fwi, the same code works with KnopflerFish). >>> >>> Thanks >>> /pierre >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org >>> For additional commands, e-mail: users-help@felix.apache.org >>> >>> >>> >> >> >> >> > > -- Karl Pauls karlpauls@gmail.com --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@felix.apache.org For additional commands, e-mail: users-help@felix.apache.org