On 12/20/01 1:04 PM, "Vincent Massol" <[EMAIL PROTECTED]> wrote: > - In order to consistently do logging (with Log4J) and configuration > (single system configuration file) in both J2EE component and Avalon > components, we have done the following : > > * Created a Logger component, > * Created a Configuration component (that uses properties file - I will > submit it for Excalibur in beginning of January), > * Defined an AbstractComponent class that is Composable, retrieve the > Logger and Configuration components from the CM and offers 2 getters :
Simply as a point of interest, in the course of looking at using Avalon with Turbine I did much the same in stratum (which is the refactoring of all the tools that have grown in turbine, a turbine commons of sorts) in order to do what need to do vis-ā-vis logging and configuration. > getLogger() and getConfiguration() > * Our Avalon components extends AbstractComponent > * We have a ComponentUtilities static class for other non EJB and non > Avalon classes (during the migration phase and before all non EJB > classes are components or attached to components) : > > public final static ComponentManager getComponentManager() > { > // Get CM from static variable > return InitialisationEJB.manager; > } > > public final static Component getComponent(String role) > { > final ComponentManager manager = getComponentManager(); > Component component; > try > { > component = manager.lookup(role); > } > catch (ComponentException e) > { > throw new CriticalException("cannot get component for role [" + > role + "]", e); > } > > return component; > } > > * We have defined a AbstractEnterpriseBean class that extends > AbstractComponent. It contains empty EJB lifecycle methods that are > common to session beans and entity beans. In the default constructor, we > call : > > compose(ComponentUtilities.getComponentManager()); > > * We also have a AbstractSessionBean and AbstractEntityBean classes that > extend AbstractEnterpriseBean and simply add the empty EJB lifecycle > methods related to Session beans and entity beans respectively. > * We have a EJBUtilities class with static methods to get EJB home and > bean reference (saved as static variables). We will probably move this > class to be a single threaded Avalon component in the future. > > Thus we are able : > - to use Avalon Components > - to use standard java classes (to be migrated to components in the > future or will act as helper classes of components) > - to use EJBs > - All 3 kinds can call each other with no problem > - All 3 kind use a unified system configuration file > - All 3 kind use a unified logging service (based on Log4j) > >> I think it would be very helpful if these >> ideas could be integrated into Berin's "Developing with Avalon" at > some >> time. I'd gladly help doing it as soon as I've finished those two >> projects I'm currently working on (that will be the beginning of > March, >> I think). >> > > definitely. + a sample j2ee application that shows it all. > > -Vincent > >> On Sat, 10 Nov 2001 18:04:51 -0000 Vincent Massol wrote: >>> Hi, >>> >>> I have just finished reading the excellent "Developing with Avalon" > PDF >>> (thanks Berin !) and am very eager to introduce Avalon in my current >> project >>> : e-business project using J2EE 1.3. >>> >>> Here is how I view the integration. I'd like to have feedback in > order >> to >>> confirm this is the best way to use Avalon in J2EE : >> >> <snip/> >> >>> What do you think ? Am I missing something ? As someone already done >> this ? >> >> Cheers, >> Jeremias Märki >> >> mailto:[EMAIL PROTECTED] >> >> OUTLINE AG >> Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern >> Fon +41 (41) 317 2020 - Fax +41 (41) 317 2029 >> Internet http://www.outline.ch >> >> >> -- >> To unsubscribe, e-mail: <mailto:avalon-dev- >> [EMAIL PROTECTED]> >> For additional commands, e-mail: <mailto:avalon-dev- >> [EMAIL PROTECTED]> >> > > > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- jvz. Jason van Zyl http://tambora.zenplex.org http://jakarta.apache.org/turbine http://jakarta.apache.org/velocity http://jakarta.apache.org/alexandria http://jakarta.apache.org/commons -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>