From: Goldsack, P. <pat...@hp...> - 2005-11-09 09:14:17
|
Its not in the Prim interface as it is not one of the remotable methods = - but I assure you that it is there in the class. When a component is created, and local to this, the deployer calls the = default constructor for the component class, then call the sfDeployWith = method passing all the data that is required to construct the component = (parent and description). After that, the deployer returns the component = handle to the requestor. As for the reference manual, I am currently (slowly) working on a = revised version - it is in the CVS - with a large amount of new = introductory "how to use" material. But this is still only partially = done. The previsouly existing content is there, but somewhat = restructured. Patrick -----Original Message----- From: Gustavo Wagner D Mendes / Pos. COPIN = [mailto:gu...@ds...]=20 Sent: 08 November 2005 20:17 To: Goldsack, Patrick; sma...@li... Cc: aan...@ds... Subject: RE: [Smartfrog-developer] Problem in the function resolution = phase Hello Patrick. Thanks for the points. But we still have doubt about the sfDeployWith = method. where is the public void sfDeployWith(Prim parent, ComponentDescritpion = Cd) method? We haven't found it in the Compound and Prim interfaces. Another doubt. Is there a new version of the SmartFlow document? I have = the 2003-2004 draft. Cheers, Gustavo On Mon, 7 Nov 2005 15:51:41 -0000, Goldsack, Patrick wrote > A number of points. >=20 > 1) The phase list should read "type, place, sfconfig (sfConfig?),=20 > link, function". In this way, you don't link and apply functions to=20 > anything other than sfConfig. >=20 > 2) If you want to keep a copy of the component description, overwrite = > the definition of sfDeployWith(ComponentDescritpion) and define it to=20 > be the following: >=20 > ComponentDescription myCd; > public void sfDeployWith(Prim parent, ComponentDescritpion Cd) > throws ... { myCd =3D cd.copy(); // must copy, as original gets = > changed by side-effect during deployment super(parent, cd); } >=20 > Hopes this helps, >=20 > Patrick >=20 > -----Original Message----- > From: sma...@li... > [mailto:sma...@li...] On Behalf Of=20 > Gustavo Wagner D Mendes / Pos. COPIN Sent: 07 November 2005 15:10 > To: Goldsack, Patrick; sma...@li... Cc:=20 > aan...@ds... Subject: RE: [Smartfrog-developer] Problem in = > the function resolution phase >=20 > Hello Patrick. How are you? >=20 > I have faced this problem when I have tried to parse a component to=20 > get its ComponentDescription. I do not know another way to get the=20 > ComponentDescription after the component is running. So, as I need the = > ComponentDescription to redeploy a component on a remote > machine, I have developed the util paserDescription method below:=09 >=20 > public static ComponentDescription parseDescription (InputStream > stream) throws RemoteException, SmartFrogException, > FileNotFoundException { Phases phases =3D new SFParser() > .sfParse(stream); > =09 > /* Resolving the phases. We don't resolve the 'sfConfig' phase = because > * it isn't a deployable component. > */=20 > phases.sfResolvePhase("type"); > phases.sfResolvePhase("place"); > phases.sfResolvePhase("link"); > phases.sfResolvePhase("function"); > =09 > return phases.sfAsComponentDescription(); =09 > }=09 >=20 > To test it, I have developed a simple component to be parsed: >=20 > #include "org/smartfrog/components.sf" > #include "org/smartfrog/functions.sf" >=20 > Teste1 extends { > sfClass "org.ourgrid.serviceprofile.teste.TesteImpl"; > } >=20 > sfConfig extends Compound { > teste1 extends Teste1; > } >=20 > I have noticed that the problem is the inclusion of the functions.sf=20 > file. Even if you don't use any function in the function.sf file, the = > problem will occur. >=20 > Am I right? >=20 > Cheers, >=20 > Gustavo >=20 > ps.: The stacktrace of the error is below: >=20 > SmartFrogCompileResolutionException:: java.lang.NullPointerException, > resolutionPhase: function > at > org.smartfrog.sfcore.languages.sf.SmartFrogCompileResolutionException.for= ward(SmartFrogCompileResolutionException.java:294) at org.smartfrog.sfcore.languages.sf.sfcomponentdescription.SFComponentDescr= iptionImpl.sfResolvePhases(SFComponentDescriptionImpl.java:662) at org.smartfrog.sfcore.languages.sf.sfcomponentdescription.SFComponentDescr= iptionImpl.sfResolvePhase(SFComponentDescriptionImpl.java:621) at org.ourgrid.serviceprofile.util.Util.parseDescription(Util.java:328) = at org.ourgrid.serviceprofile.util.UtilTest.testGetUndoComponent(UtilTest.ja= va:254) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTes= tRunner.java:478) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunn= er.java:344) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRun= ner.java:196) Caused by: java.lang.NullPointerException at = java.util.Hashtable.put(Unknown Source) at org.smartfrog.sfcore.common.OrderedHashtable.primPut(OrderedHashtable.jav= a:170) at org.smartfrog.sfcore.common.OrderedHashtable.put(OrderedHashtable.java:18= 2) at org.smartfrog.sfcore.languages.sf.functions.BaseFunction.doit(BaseFunctio= n.java:63) at org.smartfrog.sfcore.languages.sf.Phase.actOn(Phase.java:97) at org.smartfrog.sfcore.componentdescription.ComponentDescriptionImpl.visit(= ComponentDescriptionImpl.java:604) at org.smartfrog.sfcore.componentdescription.ComponentDescriptionImpl.visit(= ComponentDescriptionImpl.java:599) at org.smartfrog.sfcore.languages.sf.sfcomponentdescription.SFComponentDescr= iptionImpl.sfResolvePhases(SFComponentDescriptionImpl.java:659) ... 18 more >=20 > On Thu, 3 Nov 2005 22:17:55 -0000, Goldsack, Patrick wrote > > Gustavo, > >=20 > > Thanks for pointing this out. I wonder how this slipped through - it = > > must have been sitting there for ages without anyone noticing. The=20 > > correct function for adding its attributes is sum, not plus. The=20 > > definition of plus should probably be removed, or made to point to=20 > > the class Sum for possible backward compatability. I will consider=20 > > this and fix... > >=20 > > I am somewhat surprised that unless you actually try to use it you=20 > > get an error (or if you try to include the file directly into = sfConfig). > > Only the functions used within sfConfig should be evaulated, so a=20 > > file included at the top level will be ignored. > >=20 > > Eliminating the function phase enirely will of course remove the=20 > > problem, but I wouldn't recommend it! > >=20 > > Can you send me some more details as to why you are getting the=20 > > error message? The file you are parsing would do. > >=20 > > Thanks > > Patrick > >=20 > > -----Original Message----- > > From: sma...@li... > > [mailto:sma...@li...] On Behalf=20 > > Of Gustavo Wagner D Mendes / Pos. COPIN Sent: 03 November 2005 21:49 > > To: sma...@li... Subject: [Smartfrog-=20 > > developer] Problem in the function resolution phase > >=20 > > Hello all. > >=20 > > In the org/smartfrog/functions.sf file there is the following = component: > >=20 > > plus extends { > > phase.function > > "org.smartfrog.sfcore.languages.sf.functions.Plus"; } > >=20 > > Note that it links to the > > org/smartfrog/sfcore/languages/sf/functions/Plus.class class, but it = > > does not exists in any smartfrog distribution. If we try to parse=20 > > any component, in the function phase occurs a = ClassNotFoundException. > >=20 > > When I comment the function phase - > > //phases.sfResolvePhase("function");, it works well. > >=20 > > If you dont have the Plus class, I can do it and send to you. > >=20 > > Cheers, > >=20 > > Gustavo > >=20 > > ############################################# > > # GUSTAVO WAGNER DINIZ MENDES # > > # Graduado pela UFCG # > > # Curso: Ci=EAncia da Computa=E7=E3o # > > # Mestrando pela COPIN-UFCG # > > # * Integrante do projeto OurGrid # > > # Fones: (83)88246910 / 32358355 # > > # 33333453 # > >=20 > > ------------------------------------------------------- > > SF.Net email is sponsored by: > > Tame your development challenges with Apache's Geronimo App Server.=20 > > Download it for free - -and be entered to win a 42" plasma tv or=20 > > your very own Sony(tm)PSP. Click here to play: > http://sourceforge.net/geronimo.php > > _______________________________________________ > > Smartfrog-developer mailing list > > Sma...@li... > > https://lists.sourceforge.net/lists/listinfo/smartfrog-developer > >=20 > > ------------------------------------------------------- > > SF.Net email is sponsored by: > > Tame your development challenges with Apache's Geronimo App Server.=20 > > Download it for free - -and be entered to win a 42" plasma tv or=20 > > your very own Sony(tm)PSP. Click here to play: > > http://sourceforge.net/geronimo.php > > _______________________________________________ > > Smartfrog-developer mailing list > > Sma...@li... > > https://lists.sourceforge.net/lists/listinfo/smartfrog-developer >=20 > ############################################# > # GUSTAVO WAGNER DINIZ MENDES # > # Graduado pela UFCG # > # Curso: Ci=EAncia da Computa=E7=E3o # > # Mestrando pela COPIN-UFCG # > # * Integrante do projeto OurGrid # > # Fones: (83)88246910 / 32358355 # > # 33333453 # >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: > Tame your development challenges with Apache's Geronimo App Server.=20 > Download it for free - -and be entered to win a 42" plasma tv or your=20 > very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php > _______________________________________________ > Smartfrog-developer mailing list > Sma...@li... > https://lists.sourceforge.net/lists/listinfo/smartfrog-developer >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: > Tame your development challenges with Apache's Geronimo App Server.=20 > Download it for free - -and be entered to win a 42" plasma tv or your=20 > very own Sony(tm)PSP. Click here to play:=20 > http://sourceforge.net/geronimo.php > _______________________________________________ > Smartfrog-developer mailing list > Sma...@li... > https://lists.sourceforge.net/lists/listinfo/smartfrog-developer ############################################# # GUSTAVO WAGNER DINIZ MENDES # # Graduado pela UFCG # # Curso: Ci=EAncia da Computa=E7=E3o # # Mestrando pela COPIN-UFCG # # * Integrante do projeto OurGrid # # Fones: (83)88246910 / 32358355 # # 33333453 # |