From imperius-dev-return-34-apmail-incubator-imperius-dev-archive=incubator.apache.org@incubator.apache.org Thu Jan 03 17:04:54 2008 Return-Path: Delivered-To: apmail-incubator-imperius-dev-archive@locus.apache.org Received: (qmail 27369 invoked from network); 3 Jan 2008 17:04:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Jan 2008 17:04:54 -0000 Received: (qmail 68780 invoked by uid 500); 3 Jan 2008 17:04:43 -0000 Delivered-To: apmail-incubator-imperius-dev-archive@incubator.apache.org Received: (qmail 68761 invoked by uid 500); 3 Jan 2008 17:04:42 -0000 Mailing-List: contact imperius-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: imperius-dev@incubator.apache.org Delivered-To: mailing list imperius-dev@incubator.apache.org Received: (qmail 68752 invoked by uid 99); 3 Jan 2008 17:04:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jan 2008 09:04:42 -0800 X-ASF-Spam-Status: No, hits=-2.0 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jneeraj@us.ibm.com designates 32.97.110.149 as permitted sender) Received: from [32.97.110.149] (HELO e31.co.us.ibm.com) (32.97.110.149) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jan 2008 17:04:29 +0000 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by e31.co.us.ibm.com (8.13.8/8.13.8) with ESMTP id m03H4KRu007090 for ; Thu, 3 Jan 2008 12:04:20 -0500 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m03H4K69165066 for ; Thu, 3 Jan 2008 10:04:20 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m03H4K1b012783 for ; Thu, 3 Jan 2008 10:04:20 -0700 Received: from d03nm118.boulder.ibm.com (d03nm118.boulder.ibm.com [9.17.195.144]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m03H4KIM012779 for ; Thu, 3 Jan 2008 10:04:20 -0700 In-Reply-To: To: imperius-dev@incubator.apache.org MIME-Version: 1.0 Subject: Re: misc questions part 2 X-Mailer: Lotus Notes Release 7.0 HF277 June 21, 2006 Message-ID: From: Neeraj Joshi Date: Thu, 3 Jan 2008 12:04:19 -0500 X-MIMETrack: Serialize by Router on D03NM118/03/M/IBM(Release 8.0|August 02, 2007) at 01/03/2008 10:04:19, Serialize complete at 01/03/2008 10:04:19 Content-Type: multipart/alternative; boundary="=_alternative 005DCED5852573C5_=" X-Virus-Checked: Checked by ClamAV on apache.org --=_alternative 005DCED5852573C5_= Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable Yep I agree about seperating the tests into a seperate folder. I'll take=20 that as a TODO Thanks! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "Those are my principles. If you don't like them I have others."=20 http://incubator.apache.org/imperius =20 Neeraj Joshi Autonomic Computing Policy Development Tivoli, IBM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Craig L Russell =20 Sent by: Craig.Russell@Sun.COM 01/03/2008 11:44 AM Please respond to imperius-dev@incubator.apache.org To imperius-dev@incubator.apache.org cc Subject Re: misc questions part 2 On Jan 3, 2008, at 7:32 AM, Erik Bengtson wrote: > 14) what's the coding style in use? Do you have a formatter for=20 > eclipse? > > I want to provide patches with the correct formatting > > 10) someplaces don't have. I also suggest removing=20 > thread.currentThread.getname from logs because you can setup a=20 > logging pattern that adds that transparently. > > 12) I think Craig can add more input to that than me, but=20 > separating tests from main code might be a good idea. > Yes, the structure under src should allow the project to define test=20 cases and other resources for test and for distribution. Take a look at http://docs.codehaus.org/display/MAVEN/best+practices+-=20 +testing+strategies In particular, the directory structure trunk/ |=5F src |=5F main |=5F java |=5F resources |=5F test |=5F java |=5F resources If more complex integration testing is needed, then each such=20 integration test would have its own sub-project. But imperius might=20 not need this level of complexity. Craig > > -- BlackBerry=AE from Mobistar --- > > -----Original Message----- > From: Neeraj Joshi > > Date: Thu, 3 Jan 2008 09:48:09 > To:imperius-dev@incubator.apache.org > Subject: Re: misc questions part 2 > > > Hi Erik, > 3) You are right. For some reason I thought you meant a GUI. > > 4 & 6) I think its a great idea it will simplify the user's code.=20 > Actually > let me take a crack > at it. So the 2 changes would be as follows: 1) The user provides a=20 > map > with instancename -> instanceobject > and 2) the evaluator will silently ignore instances that are not=20 > imported > inside the policy > > 7) I agree XML for the customexpressions is more elegant than=20 > properties, > I also agree about externalizing all the in-built expressions > (acplparsermap) as an XML. Looking > forward to your patch. > > 8) Good point I will add the privileged blocks whereever required > > 9 & 13) Will look into the logging and cleaning up code > > 10) I think most of the places we do have statements like this: > > if(logger.isLoggable(Level.FINE)) > logger.fine(Thread.currentThread().getName()+" iterating over=20 > instances " > ); > > Is that not sufficient or have we missed putting the if in some=20 > places? > > 11) As a matter of fact in our original ANT build we had it built as a > seperate jar but then while migrating to maven > in the interest of time we put it all together. Will work on=20 > seperating it > out > > 12) I suppose this is the maven convention? Again in the interest=20 > of time > I didn't change the folder structure, do you see a > compelling reason for this? I noticed some other projects like=20 > Apache Muse > weren't following it either > > 14) I personally don't prefer the Apache Geronimo style but if=20 > everyone > feels strongly about this I am OK with changing it. > > 15) Please do provide a patch. > > Again we appreciate your in depth feedback! > Neeraj > > > > > > > > > > 3) >> NRJ: The factory is a good idea. What do you have in mind in terms=20 >> of a >> user interface? > > I just thought in rationalizing the current APIs and make all user=20 > exposed > methods interface based. > > If I understand correctly, there are two kinds of API: User API,=20 > Service > Provider Implementation API > > User API is the user view to imperius > SPI API is for instance the datastore interfaces, mostly the one in=20 > the > external > packages. > > 4) >> NRJ- There is a direct correlation between the arguments passed to=20 >> the >> evaluatePolicy method and the imported classes/instances within the >> policy. >> For e.g. >> >> If the import statement in the policy is as follows: >> >> Import Class a : a1,a2; >> Import Class b: b1,b2; >> >> Then the evaluatePolicy method call would have inputMap as the=20 >> parameter >> >> where >> Map inputMap =3D ["a" --> instanceInfoListForA] >> ["b" --> instanceInfoListForB ] >> >> where >> instanceInfoListForA =3D [instanceInfoA1 , instanceInfoA2] >> instanceInfoLIstForB =3D [instanceInfoB1 , instanceInfoB2 ] > > IMO non declared instanceinfo objects could be silently ignored. e.g. > > > Map inputMap =3D ["a" --> instanceInfoListForA] > ["b" --> instanceInfoListForB ] > ["c" --> instanceInfoListForC ] > > > where > instanceInfoListForA =3D [instanceInfoA1 , instanceInfoA2] > instanceInfoLIstForB =3D [instanceInfoB1 , instanceInfoB2,=20 > instanceInfoB3 ] > instanceInfoLIstForC =3D [instanceInfoC1 ] > > > B3 and C1 could be silently ignored since the policy has: > >> Import Class a : a1,a2; >> Import Class b: b1,b2; > > I can create a patch if you agree. > > 6) Simplified User API by hiding InstanceInfo? > > e.g. > > Map map =3D new HashMap(); > map.put("a1", myobjecta1); > map.put("a2", myobjecta2); > map.put("b1", myobjectb1); > map.put("b2", myobjectb2); > > spl.executePolicy(name,map); > > Internally, PolicyManager.executePolicy can create InstanceInfo. > > > 7) Properties Loader (customexpressions): Currently custom=20 > expressions are > configured in a property file placed at the user.dir or splhome. I=20 > propose > the > following: > > - change properties to xml format > - default naming of the file would change from > customexpressions.properties to > imperius.xml > - imperius.xml would be loaded by default from the locations: cur.dir, > user.dir > and splhome. > - allow configuring customexpressions via the SPLPolicyRuleProvider > interface. > The operation void registerExpressions(InputStream xml) is added to=20 > the > SPLPolicyRuleProvider. > > > > > > > > > - Externalize ACPLParserMap expressions registration to another XML=20 > file: > org.apache.imperius.spl.Expressions.xml > > I can also provide a patch. > > 8) Access to protected resources. System.getProperty,=20 > Class.forName, etc > > None of the access to these resources happen in privilege blocks, so > imperius > won't work in secured environment. > > 9) Cosmetic: There are plenty of messages output to system.out. These > should be > moved to log. > > 10) Logging code should be enclosed within a check condition: > > e.g. > > if( logger.isDebugEnabled() ) > { > logger.debug(xxxx) > } > > 11) Samples in the JavaSPL should be moved to its own module. I=20 > propose > javaspl-samples > > 12) Unit tests should be moved to /src/test/ > > 12) Sources should be moved from /src/ to /src/java/ or /src/main/ > > 13) Cleanup code: Remove commented out code; Remove empty methods=20 > such as > static > mains..; make classes private when possible > > 14) Code Formatting: use of Apache Geronimo coding style? > > 15) Prevent nullpointerexceptions. in some cases I got NPE, so need to > prevent > these situations. I propose to create unit tests for the test cases=20 > I have > and > provide a patch. > > Regards > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > "Those are my principles. If you don't like them I have others." > > Neeraj Joshi > Autonomic Computing Policy Development > Tivoli, IBM > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Craig Russell Architect, Sun Java Enterprise System http://java.sun.com/products/jdo 408 276-5638 mailto:Craig.Russell@sun.com P.S. A good JDO? O, Gasp! --=_alternative 005DCED5852573C5_=--