Return-Path: Delivered-To: apmail-incubator-river-dev-archive@minotaur.apache.org Received: (qmail 66103 invoked from network); 1 Feb 2011 01:30:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Feb 2011 01:30:41 -0000 Received: (qmail 51092 invoked by uid 500); 1 Feb 2011 01:30:41 -0000 Delivered-To: apmail-incubator-river-dev-archive@incubator.apache.org Received: (qmail 51056 invoked by uid 500); 1 Feb 2011 01:30:40 -0000 Mailing-List: contact river-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: river-dev@incubator.apache.org Delivered-To: mailing list river-dev@incubator.apache.org Received: (qmail 51048 invoked by uid 99); 1 Feb 2011 01:30:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Feb 2011 01:30:40 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of SRS0=AgdHTO=U6=wonderly.org=gregg@yourhostingaccount.com designates 65.254.253.43 as permitted sender) Received: from [65.254.253.43] (HELO mailout05.yourhostingaccount.com) (65.254.253.43) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Feb 2011 01:30:32 +0000 Received: from mailscan15.yourhostingaccount.com ([10.1.15.15] helo=mailscan15.yourhostingaccount.com) by mailout05.yourhostingaccount.com with esmtp (Exim) id 1Pk54N-0001nG-G8 for river-dev@incubator.apache.org; Mon, 31 Jan 2011 20:30:11 -0500 Received: from impout03.yourhostingaccount.com ([10.1.55.3] helo=impout03.yourhostingaccount.com) by mailscan15.yourhostingaccount.com with esmtp (Exim) id 1Pk54N-0006X2-3Y for river-dev@incubator.apache.org; Mon, 31 Jan 2011 20:30:11 -0500 Received: from authsmtp08.yourhostingaccount.com ([10.1.18.8]) by impout03.yourhostingaccount.com with NO UCE id 2RWA1g00V0ASqTN0000000; Mon, 31 Jan 2011 20:30:11 -0500 X-EN-OrigOutIP: 10.1.18.8 X-EN-IMPSID: 2RWA1g00V0ASqTN0000000 Received: from ip70-189-103-32.ok.ok.cox.net ([70.189.103.32] helo=[192.168.1.105]) by authsmtp08.yourhostingaccount.com with esmtpa (Exim) id 1Pk54M-0007X8-Ei for river-dev@incubator.apache.org; Mon, 31 Jan 2011 20:30:10 -0500 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1082) Subject: Re: MarshalledServiceItem From: Gregg Wonderly In-Reply-To: <4D45C8A5.6010309@zeus.net.au> Date: Mon, 31 Jan 2011 19:29:47 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <52044E7A-F5A2-4470-AA5F-9922C0328639@wonderly.org> References: <4D45C8A5.6010309@zeus.net.au> To: river-dev@incubator.apache.org X-Mailer: Apple Mail (2.1082) X-EN-UserInfo: 5bac21c6012e8295aaee92c67842fba3:d1e94006e19829b2b3cf849ab9ff0f3c X-EN-AuthUser: greggwon Sender: Gregg Wonderly X-EN-OrigIP: 70.189.103.32 X-EN-OrigHost: ip70-189-103-32.ok.ok.cox.net One of the important things for my use of my changes to the = ServiceRegistrar interface was separating deserialization of the Entrys = from the service object. Ultimately, I wanted to not have to worry = about how the "codebase" was structured in order to minimize = downloading. Some Jini deployers have done things to put a small jar at = the front of the codebase that just has the preferred.list in it. Even = that download, for me, would have been too much. My customers' = deployments have nearly 50 codebases visible when my client starts up. = Those 50 connections over a cellular or other high latency network would = make service selection take way too long. Being able to defer downloading was also controlled by the changes to = ClassLoading to include the "neverPrefer" settings on a class name. I = can do that now through the recent RMIClassLoaderSPI override = capabilities. But I still need to be able to control which Entry is = deserialized. I need to be able to ask what classes, by name, are in = the namespace of each Entry object as my implementation allowed. I had = made changes to Reggie marshalling to use reflection to get the class = hierarchy, and then provided access to the list of classnames as part of = the returned, marshalled value in my API. Gregg Wonderly On Jan 30, 2011, at 2:23 PM, Peter Firmstone wrote: > Gut feel, tells me the following class is not right, it's intent is to = provide an api for implementation of delayed unmarshalling and = provisioning of codebases, for services implementing a lookup service or = ServiceRegistrar, whilst retaining backward compatibility. >=20 > In other words, the lookup service proxy would implement it. >=20 > Thoughts I had were to declare IOException's on methods, and to return = a String annotation, rather than a URI. >=20 > What are your thoughts? >=20 > Cheers, >=20 > Peter. >=20 > /* > * Licensed to the Apache Software Foundation (ASF) under one > * or more contributor license agreements. See the NOTICE file > * distributed with this work for additional information > * regarding copyright ownership. The ASF licenses this file > * to you under the Apache License, Version 2.0 (the > * "License"); you may not use this file except in compliance > * with the License. You may obtain a copy of the License at > * > * http://www.apache.org/licenses/LICENSE-2.0 > * > * Unless required by applicable law or agreed to in writing, software > * distributed under the License is distributed on an "AS IS" BASIS, > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or = implied. > * See the License for the specific language governing permissions and > * limitations under the License. > */ >=20 > package org.apache.river.api.lookup; >=20 > import java.net.URI; > import java.security.CodeSource; > import net.jini.core.entry.Entry; > import net.jini.core.lookup.ServiceID; > import net.jini.core.lookup.ServiceItem; >=20 > /** > * MarshalledServiceItem extends ServiceItem and can be used anywhere a > * ServiceItem can. A MarshalledServiceItem implementation instance > * contains the marshalled form of a Service and it's Entry's, > * the corresponding superclass ServiceItem however contains null = values > * for the service and can exclude any Entry's, however where Entry > * classes already exist at the client, that they be unmarshalled. > * > * The ServiceID shall be in unmarshalled form always in the = ServiceItem super class. > * > * Since the ServiceItem.service is null, use of this class in existing = software > * will not return the service, however it will not break that software = as > * ServiceItem's contract is to set service or Entry's to null when = they cannot > * be unmarshalled. > * > * ServiceItem's toString() method will return a different result for > * MarshalledServiceItem instances. > * > * If required, a new ServiceItem that is fully unmarshalled > * can be constructed from this class's methods and ServiceID. > * > * @author Peter Firmstone. > */ > public abstract class MarshalledServiceItem extends ServiceItem{ > private static final long SerialVersionUID =3D 1L; > protected MarshalledServiceItem(ServiceID id, Entry[] = unmarshalledEntries){ > super(id, (Object) null, unmarshalledEntries); > } > /** > * Unmarshall the service proxy. > * @param load service with local or existing CodeSource or null for > * default. > * @return the service proxy, null if class not found. > */ > public abstract Object getService(CodeSource[] code); > /** > * Unmarshall the Entry's > * @return array of Entry's, null entry in array for any class not = found. > */ > public abstract Entry[] getEntries(); > public abstract URI[] getAnnotations(); > } >=20