Thanks! Raymond. I'll express clearer in the future. :-), I just met some problem and resolved it later, so I posted it. Your comments for the service name improved my understanding of it. Thanks.
2008/11/13 Raymond Feng <[EMAIL PROTECTED]> > I assume you want some clarifications even though you didn't raise a > question :-). > > The behavior is defined by the SCA spec. There are a few cases to define an > SCA service for the implementation class: > > 1) @Service is used to annotate the implementation class, then each > interface in the value denotes an SCA service > 2) If one or more interfaces implemented by the impl class have the > @Remotable annotation, then those remotable interfaces denote SCA services > 3) Default to the implementation class as the "interface" for the SCA > service > > The name of an SCA java service is the local name, in your case, > DServiceImpl. > > Thanks, > Raymond > > From: kujunguo kujunguo > Sent: Wednesday, November 12, 2008 6:14 PM > To: [email protected] > Subject: The default service name is the same as the Java implementation > class name > > > > If we don't define service in java implementation class or the > componentType file, the default service is the same as implementation class. > for example, the java class is like: > public class DServiceImpl { > public String sayHello() { > return "Hello" ; > } > } > The componentType is : > <componentType> > <implementation.java class="com.ibm.was.sca.DServiceImpl"/> > </componentType> > > The composite file is : > <composite> > <component name="Component"> > <implementation.java class="com.ibm.was.sca.DServiceImpl"/> > </component> > > </composite> > You can pass the test with: DService service = > ServiceFinder.getService(DService.class, "Component/DServiceImpl"); > If you add a <service> in the composite file: > <composite> > <component name="Component"> > <implementation.java class="com.ibm.was.sca.DServiceImpl"/> > <service name="DService1"> > <interface.java interface="com.ibm.was.sca.DService"/> > </service> > </component> > </composite> > You can still get the service with the name "Component/DServiceImpl", but > it will report a warning: > WARNING: Skipping component service not defined in the component type: > Component#DService1 > Then if you specify another name in the componentType: > <componentType> > <implementation.java class="com.ibm.was.sca.DServiceImpl"/> > <service name="DService1"> > <interface.java interface="com.ibm.was.sca.DService"/> > </service> > </componentType> > Now the service name will be changed to DService1, so you will not get the > service by "Component/DServiceImpl". You have to use DService1 instead. > If you change the name in composite file from DService1 to DService2, you > can still get the service with name "Component/DService1" but with a > warning: > WARNING: Skipping component service not defined in the component type: > Component#DService2 > Now change the DService2 to DServiceImpl in composite file, there will be > no warning, all can pass. > So DServiceImpl is a specical name, a default name. >
