hivemind-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Jakarta-hivemind Wiki] Update of "DescriptorApiRevampProposal" by KnutWannheden
Date Fri, 04 Aug 2006 15:36:07 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jakarta-hivemind Wiki" for change
notification.

The following page has been changed by KnutWannheden:
http://wiki.apache.org/jakarta-hivemind/DescriptorApiRevampProposal

------------------------------------------------------------------------------
  Here is an overview of the proposed Descriptor API (package {{{org.apache.hivemind.descriptor}}}).
  
  {{{
- public interface Module
+ public interface ModuleDef
  {
      public String getId();
      public String getVersion();
+     public ClassResolver getClassResolver();
+ 
+     public List getServicePoints();
+     public List getConfigurationPoints();
+     public List getImplementations();
+     public List getInterceptors();
+     public List getContributions();
  }
  }}}
  
  {{{
- public interface ExtensionPoint
+ public interface ExtensionPointDef
  {
+     public ModuleDef getModule();
      public String getId();
      public Visibility getVisibility();
-     public String getSchemaId();
+     public boolean isVisibleTo(ModuleDef module);
  }
  }}}
  
  {{{
- public interface Extension
+ public interface ExtensionDef
  {
+     public ModuleDef getModule();
      public String getExtensionPointId();
+     public boolean isApplicable(DefContext context);
  }
  }}}
  
  {{{
- public interface ServicePoint extends ExtensionPoint
+ public interface ServicePointDef extends ExtensionPointDef
  {
      public String getInterfaceName();
  }
  }}}
  
  {{{
- public interface Implementation extends Extension
+ public interface ConfigurationPointDef extends ExtensionPointDef
  {
+     public Occurances getCount();
-     public String getServiceModel();
-     public ServiceImplementationConstructor getConstructor();
  }
  }}}
  
  {{{
- public interface Interceptor extends Extension
+ public interface ImplementationDef extends ExtensionDef
  {
-     public String getName();
+     public String getServiceModel();
-     public ServiceInterceptorConstructor getConstructor();
+     public ImplementationConstructor getConstructor(DefContext context);
  }
  }}}
  
  {{{
- public interface ConfigurationPoint extends ExtensionPoint
+ public interface InterceptorDef extends ExtensionDef
  {
-     public Occurances getCount();
-     public boolean canElementsBeMapped();
+     public String getName();
+     public InterceptorConstructor getConstructor(DefContext context);
  }
  }}}
  
  {{{
- public interface Contribution extends Extension
+ public interface ContributionDef extends ExtensionDef
  {
-     public ConfigurationContributionConstructor getConstructor();
+     public ContributionConstructor getConstructor(DefContext context);
  }
  }}}
  
  {{{
- public interface Schema
+ public interface DefContext
  {
-     public String getId();
-     public Visibility getVisibility();
+     public ModuleDef getModule(String id);
+     public ServicePointDef getServicePoint(String id);
  }
  }}}
  
  Some important notes:
-  * Possibly the interfaces should all have a ''Descriptor'' suffix to avoid confusion with
existing internal interfaces.
-  * The link between a module and its constituents (i.e. extension points, extensions, and
schemas) is established using a visitor pattern.  For reasons of brevity the {{{public void
accept(DescriptorVisitor visitor)}}} method on the various interfaces is not shown.
   * The ''!RegistryBuilder'' part of the Descriptor API has been left out, as it should remain
the same.
-  * The ordering of interceptors (and eventually configuration contributions) is here not
explicitly addressed but could be realized by letting an implementation also implement the
!HiveMind {{{Orderable}}} interface.
+  * Ordering of interceptors could also be addressed by letting an implementing object implement
the !HiveMind {{{Orderable}}} interface.
-  * The {{{getConstructor()}}} methods in ''Implementation'', ''Interceptor'', and ''Contribution''
establish the link to the Runtime API.  The returned objects will be used at runtime to lazily
instantiate the actual objects.  The referenced interfaces are described in the following.
+  * The {{{getConstructor()}}} methods in ''ImplementationDef'', ''InterceptorDef'', and
''ContributionDef'' establish the link to the Runtime API.  The returned objects will be used
at runtime to lazily instantiate the actual objects.  The referenced interfaces are described
in the following.
  
  == Runtime API ==
  As mentioned the {{{getConstructor()}}} methods on the ''Extension'' subtypes establish
the link to the Runtime API.  Here are the referenced interfaces thereof.  Note that the types
of the method arguments in these interfaces are the internal interfaces and '''not''' the
just described Descriptor API interfaces.
  
  {{{
- public interface ServiceImplementationConstructor
+ public interface ImplementationConstructor
  {
      public Object constructCoreServiceImplementation(ServicePoint servicePoint,
              Module contributingModule);
@@ -106, +113 @@

  }}}
  
  {{{
- public interface ServiceInterceptorConstructor
+ public interface InterceptorConstructor
  {
      public Object constructServiceInterceptor(InterceptorStack interceptorStack,
              Module contributingModule);
@@ -114, +121 @@

  }}}
  
  {{{
- public interface ConfigurationContributionConstructor
+ public interface ContributionConstructor
  {
-     public Object constructContributionKey(ConfigurationPoint configurationPoint,
+     public Object contributeOrderedElements(OrderedConfiguration configuration,
              Module contributingModule);
  
-     public Object constructContributionElement(ConfigurationPoint configurationPoint,
+     public Object contributeMappedElements(MappedConfiguration configuration,
              Module contributingModule);
  }
  }}}
  
  Some notes:
-  * The interfaces ''!ServiceImplementationConstructor'' and ''!ServiceInterceptorConstructor''
already exist (although with different names). The difference is that the ''context'' is provided
as explicit method arguments.
+  * The interfaces ''!ImplementationConstructor'' and ''!InterceptorConstructor'' already
exist (although with different names). The difference is that here the ''context'' is provided
as explicit method arguments.
-  * The interface ''!ConfigurationContributionConstructor'' does not have correspondance
in the current code.
+  * The interface ''!ContributionConstructor'' does not have correspondance in the current
code.
  
  = Discussion =
  

Mime
View raw message