You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Jim Marino <jm...@myromatours.com> on 2006/10/02 09:10:47 UTC

component hierarchy refactorings and system service support

Hi,

I checked some changes in to support system services scoped to a  
composite hierarchy in the Java SCA runtime. This will allow us to  
add support for things such as type systems specific to an  
application and programming model extensions such as OpenJPA and  
Hibernate.

As part of this, the SystemCompositeComponent and AutowireComponent  
specializations have been removed, leaving CompositeComponentImpl as  
the composite implementation that forms both the application and  
system runtime trees. Previously, each composite contained one set of  
children. This has been changed so that each composite will contain a  
collection of application and system children in separate namespaces.  
Each composite on the "application" side of the runtime composite  
hierarchy may contain both application and system children. For  
example, normal user-provided application artifacts and system  
services such as a type registry or EJB3 entity manager factory.   
Composites on the "system" side of the runtime will only contain  
system artifacts as children and will not have any application  
children (the collections will be empty).

The application and system sides of the CompositeComponentImpl are  
distinct. Fro example, autowiring on the system side will traverse up  
the system side of the runtime hierarchy while application components  
may not autowire to system targets.   Since system and application  
children are kept separate to avoid collisions, additional APIs have  
been added to CompositeComponent for navigating the hierarchy (e.g.  
getSystemChild).

Also, in line with these changes, I removed AutowireComponent and  
moved the methods up to CompositeComponent. In addition to removing  
casts, this will allow us to add support for autowiring application  
components, which will hopefully be included in the SCA specs soon.

Finally, I moved SystemAtomicComponent to SPI so that people can  
create custom system extensions. This will allow us to add support  
for OpenJPA and Hibernate where an EntityManagerFactory and  
SessionFactory respectively are managed by a custom system atomic  
component contained in an application composite. An injector can be  
used to access that system component and inject a JPA EntityManager  
or Hibernate Session onto a component instance. Similarly, a type  
system helper could be stored in a system component for use by an  
application.

Jim
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: component hierarchy refactorings and system service support

Posted by Raymond Feng <en...@gmail.com>.
Hi, Jim.

Your changes seem to be causing some regressions. I got the following 
exception in a web srevice sample now.

Thread [main] (Suspended (exception NullPointerException))
 DefaultRuntime(CompositeComponentExtension).resolveSystemInstance(Class<T>) 
line: 390
 CompositeComponentImpl(CompositeComponentExtension).resolveSystemInstance(Class<T>)line: 390 CompositeComponentImpl(CompositeComponentExtension).resolveSystemInstance(Class<T>) line: 390 CompositeComponentImpl(CompositeComponentExtension).resolveSystemInstance(Class<T>) line: 390 SystemOutboundAutowire.getTargetService() line: 84 SystemWireObjectFactory.getInstance() line: 40 MethodInjector<T>.inject(T) line: 46 SystemAtomicComponentImpl(PojoAtomicComponent).createInstance() line: 123 ModuleScopeContainer.eagerInitComponents() line: 144 ModuleScopeContainer.onEvent(Event) line: 72 CompositeComponentImpl(AbstractSCAObject).publish(Event) line: 94 CompositeComponentImpl(AbstractCompositeComponent).publish(Event) line: 136 CompositeComponentImpl(AbstractCompositeComponent).start() line: 106 HelloWorldWSClientTestCase(SCATestCase).deployExtension(CompositeComponent,String, URL) line: 98 HelloWorldWSClientTestCase(SCATestCase).setUp() line: 58 HelloWorldWSClientTestCase.setUp() line: 29 HelloWorldWSClientTestCase(TestCase).runBare() line: 125 TestResult$1.protect() line: 106 TestResult.runProtected(Test, Protectable) line: 124 TestResult.run(TestCase) line: 109 HelloWorldWSClientTestCase(TestCase).run(TestResult) line: 118 TestSuite.runTest(Test, TestResult) line: 208 TestSuite.run(TestResult) line: 203 JUnit3TestReference.run(TestExecution) line: 128 TestExecution.run(ITestReference[]) line: 38 RemoteTestRunner.runTests(String[], String, TestExecution) line: 460 RemoteTestRunner.runTests(TestExecution) line: 673 RemoteTestRunner.run() line: 386 RemoteTestRunner.main(String[]) line: 196Any clue?Thanks,Raymond----- Original Message -----From: "Jim Marino" <jm...@myromatours.com>To: <tu...@ws.apache.org>Sent: Monday, October 02, 2006 12:10 AMSubject: component hierarchy refactorings and system service support> Hi,>> I checked some changes in to support system services scoped to acomposite hierarchy in the Java SCA runtime. This will allow us to  addsupport for things such as type systems specific to an  application andprogramming model extensions such as OpenJPA and  Hibernate.>> As part of this, the SystemCompositeComponent and AutowireComponentspecializations have been removed, leaving CompositeComponentImpl as  thecomposite implementation that forms both the application and  system runtimetrees. Previously, each composite contained one set of  children. This hasbeen changed so that each composite will contain a  collection ofapplication and system children in separate namespaces.  Each composite onthe "application" side of the runtime composite  hierarchy may contain bothapplication and system children. For  example, normal user-providedapplication artifacts and system  services such as a type registry or EJB3entity manager factory.   Composites on the "system" side of the runtimewill only contain  system artifacts as children and will not have anyapplication  children (the collections will be empty).>> The application and system sides of the CompositeComponentImpl aredistinct. Fro example, autowiring on the system side will traverse up  thesystem side of the runtime hierarchy while application components  may notautowire to system targets.   Since system and application  children arekept separate to avoid collisions, additional APIs have  been added toCompositeComponent for navigating the hierarchy (e.g.  getSystemChild).>> Also, in line with these changes, I removed AutowireComponent and  movedthe methods up to CompositeComponent. In addition to removing  casts, thiswill allow us to add support for autowiring application  components, whichwill hopefully be included in the SCA specs soon.>> Finally, I moved SystemAtomicComponent to SPI so that people can  createcustom system extensions. This will allow us to add support  for OpenJPA andHibernate where an EntityManagerFactory and  SessionFactory respectively aremanaged by a custom system atomic  component contained in an applicationcomposite. An injector can be  used to access that system component andinject a JPA EntityManager  or Hibernate Session onto a component instance.Similarly, a type  system helper could be stored in a system component foruse by an  application.>> Jim>> ---------------------------------------------------------------------> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org> For additional commands, e-mail: tuscany-dev-help@ws.apache.org>

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org