admin@glassfish.java.net

Re: Applications vs SystemApplications

From: Kedar Mhaswade <Kedar.Mhaswade_at_Sun.COM>
Date: Fri, 19 Sep 2008 14:40:16 -0700

Lloyd Chambers wrote:
> If they're the same thing, perhaps SystemApplications can extend
> Applications or we can have a common base class with the DuckTyped stuff?

It can. Don't know if DuckTyped methods can get inherited though. I haven't
tested it.

> I just don't know the intent here.

The intent of system-applications is to have a separate place for those
apps that are generally system-required, and loaded on demand.

-Kedar

>
> On Sep 19, 2008, at 2:34 PM, Kedar Mhaswade wrote:
>
>>
>>
>> Lloyd Chambers wrote:
>>> I notice we have a DuckTyped getModules() for Applications, but not
>>> SystemApplications.
>>> Anyone know if we intend these two to have the same facilities?
>>
>> I sure hope so.
>>
>> At the moment, there is only one system application -- admin console.
>>
>>
>> -Kedar
>>
>>> Lloyd
>>> ---------------
>>> @Configured
>>> public interface SystemApplications extends ConfigBeanProxy,
>>> Injectable {
>>> /**
>>> * Gets the value of the
>>> lifecycleModuleOrJ2EeApplicationOrEjbModuleOrWebModuleOrConnectorModuleOrAppclientModuleOrMbeanOrExtensionModuleorApplication property.
>>> * Objects of the following type(s) are allowed in the list
>>> * {_at_link LifecycleModule }
>>> * {_at_link J2EeApplication }
>>> * {_at_link EjbModule }
>>> * {_at_link WebModule }
>>> * {_at_link ConnectorModule }
>>> * {_at_link AppclientModule }
>>> * {_at_link Mbean }
>>> * {_at_link ExtensionModule }
>>> * {_at_link Application }
>>> */
>>> @Element("*")
>>> public List<Module> getModules();
>>> }
>>> --------------
>>> @Configured
>>> public interface Applications extends ConfigBeanProxy, Injectable {
>>> /**
>>> * Gets the value of the
>>> lifecycleModuleOrJ2EeApplicationOrEjbModuleOrWebModuleOrConnectorModuleOrAppclientModuleOrMbeanOrExtensionModuleorApplication property.
>>> * Objects of the following type(s) are allowed in the list
>>> * {_at_link LifecycleModule }
>>> * {_at_link J2eeApplication }
>>> * {_at_link EjbModule }
>>> * {_at_link WebModule }
>>> * {_at_link ConnectorModule }
>>> * {_at_link AppclientModule }
>>> * {_at_link Mbean }
>>> * {_at_link ExtensionModule }
>>> * {_at_link Application }
>>> */
>>> @Element("*")
>>> public List<Module> getModules();
>>> /**
>>> * Gets a subset of {_at_link #getModules()} that has the given type.
>>> */
>>> @DuckTyped
>>> <T> List<T> getModules(Class<T> type);
>>> @DuckTyped
>>> <T> T getModule(Class<T> type, String moduleID);
>>> public class Duck {
>>> public static <T> List<T> getModules(Applications apps,
>>> Class<T> type) {
>>> List<T> modules = new ArrayList<T>();
>>> for (Object module : apps.getModules()) {
>>> if (type.isInstance(module)) {
>>> modules.add(type.cast(module));
>>> }
>>> }
>>> return modules;
>>> }
>>> public static <T> T getModule(Applications apps, Class<T>
>>> type, String moduleID) {
>>> if (moduleID == null) {
>>> return null;
>>> }
>>> for (Module module : apps.getModules())
>>> if (type.isInstance(module) &&
>>> module.getName().equals(moduleID))
>>> return type.cast(module);
>>> return null;
>>> }
>>> }
>>> }
>>> ..............................................
>>> Lloyd Chambers
>>> lloyd.chambers_at_sun.com
>>> GlassFish team, LSARC member
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net
>