From: Guijarro, J. <jul...@hp...> - 2004-06-24 13:27:25
|
> -----Original Message----- > From: Glenn Hisdal [mailto:hi...@st...] > Sent: 18 June 2004 11:14 > To: Guijarro, Julio > Cc: sma...@li... > Subject: Re: Finding components... > > Hello, > > Guijarro, Julio wrote: > > >>>> Did you try to advertise SF references? > >>> > >>> No, didn't try that. Since a reference can be built from a canonical > >>> name, I guess I could advertise them in the same way and just rebuild > >>> the reference from the canonical name when it is received ? > >>> > >>> [JULIO] Yes, but sometimes can be better to send the Reference > >>> object. > >>> The > >>> most important feature is that References can contain indirections. > >>> And > >>> these indirections can be completely dynamic. It is also easier to > >>> work with > >>> native Refs than Strings ;-) > > So the Reference object can contain information that will not be > included when it is converted to a canonical name String ? Not, with its actual implementation there is a one to one mapping. But creating a reference from a string implies loading the parser and it is a heavy operation. Also, when using the SF language it could be that the data that you want to adv. is a Ref or a String or a Int or a RMI stub, ... you don't know in advances and it should not be hard coded. Example: using "advertise" attribute to select what to advertise: advertise 1; -> advertises Integer advertise LAZY x; -> advertises RMI stub to a component; advertise LAZY extends ComponentDescription; -> advertises a component description advertise "hola"; -> advertises a string; advertise LAZY sfCannonicalName; -> I will make this available; -> advertises cannonicalName; advertise LAZY sfProcessComponentName; -> advertises processName advertise LAZY sfHost; -> advertises host name; advertise [1,2,3]; -> advertises vector. > In order to just locate the Component, the canonical name should always > work, right ? Yes unless something changes in its parentage chain. > So, I could have something like this: > Advertise component: > service:sf-prim:///<canonical_name_string> > Advertise SF reference to component: > service:sf-reference:///<string_encoded_reference_object> > > This could probably be handled by the PrimAdvertiser component. An > attribute could say if it should advertise the component, the reference > or both. > A ReferenceLocator could be written to find and return a reference to a > component. i.e: > refLoc extends ReferenceLocator; > primLoc extends PrimLocator; > sfConfig extends Compound { > theReference LAZY refLoc:result; > theComponent LAZY primLoc:result; > } > > It would probably also be useful if the components could return a > Vector of all the discovered components/references ? It should be up to the component to select what to advertise. > > > Can you advertise any arbitrary object in the same way you advertise > > rmi > > stubs? > > It should be possible to make a String representation of any > serializable object and add that to the URL path. > This would be similar to the Reference advertisement: > service:<some_type>:///<string_encoded_object> > > I could make some extensions to the ServiceURL class allowing it to > handle objects in an easy way: > - contructor which can take an object and automatically convert it to a > String. > - A method getURLPathObject() which will convert the URLPath to an > object and return the object (if possible). > > > - glenn |