[SOLVED] CCM Service component development
Joao Bosco Jares A. Chaves (32●4●8●13)
| asked Aug 05 '13, 12:31 p.m.
edited Sep 02 '13, 10:35 a.m. by Ralph Schoon (63.6k●3●36●46)
Hi Folks,
I have found many articles that explain advisor development, but until now I have not found anything to explain how to expose a new component service as we can found at https://localhost:9443/ccm/admin?internal=true#action=com.ibm.team.repository.admin.componentStatus. When I deploy a new advisor as plugin manner, this advisor is shown in the component status list as "No Services", but I want to define services for him. How can I do it?
Thanks.
|
Accepted answer
RTC supports a client (library) calling a server side service. they marshall all the parameters and the results.
the 'interface' is the api definition. the client needs to 'call it' and the server needs to 'implement it' so you build two jar files.. interface and client code and interface and server service code you also have some client application, that uses the client library to get data from the server, thru the service interface definition. Joao Bosco Jares A. Chaves selected this answer as the correct answer
|
5 other answers
I have created my own services..
these require 3 parts interface service implemention client implementation <code> here is my interface definition public interface IRepositoryFileService { public String getSpecialVolumePrefix(); public int getSpecialFileSize(); public Object getServerProperty(String id); } here is the top of my implemention public class RepositoryFileService extends AbstractService implements IRepositoryFileService here is the xml in plugin.xml for the serer side <extension point="com.ibm.team.repository.service.serviceProvider"> <serviceProvider componentId="com.xx.remoterepository" implementationClass="com.xx.repository.service.RepositoryFileService"> <provides> <providedService interface="com.xx.repository.service.IRepositoryFileService"/> </provides> <prerequisites> <requiredService interface="com.ibm.team.repository.common.internal.IRepositoryRemoteService"> </requiredService> </serviceProvider> </extension> on the client side, I wanted to use the client interface (getClientLibrary) make an interface public interface IFileParmClient { Object getProperty(String id ); String getSpecialVolumePrefix(); int getSpecialFileSize(); } make a class that implements it public final class FileParmClient implements IFileParmClient{ } create the client library factory public class FileParmClientLibraryFactory extends ClientLibraryFactory { @Override public Object createClientLibrary(IClientLibraryContext context) { return new FileParmClient(context); } } ---- using this client interface (this is another service class, which has a simpler sample) ISynchParmClient p= getVarService(); if(p!=null) { System.out.println("calling to get parms"); Varlist = (String)p.getProperty("sfdc.fieldstosynch"); System.out.println("Varlist='"+Varlist+"'"); } else System.out.println("unable to locate parms service"); } private static ISynchParmClient IVarService=null; private static ISynchParmClient getVarService() { if(IVarService==null) IVarService=(ISynchParmClient)getRepository().getClientLibrary(ISynchParmClient.class); if(IVarService==null) System.out.println("parm client get library failed"); return IVarService; } </code> |
my services do NOT show in the active service list however.
their parameters DO show in the list of config properties in the advanced server admin panel. |
Thanks a lot, one more time sam.
Best Regards.
Comments
sam detweiler
commented Aug 05 '13, 4:19 p.m.
you're welcome.. I forgot to mention the interface/server/client split.
|
sam,
Just now I have time to put to run your response, however I can not understand the relation between service, client and interface. So, I have some more questions to you as bellow:
a) What is the deploy topology between server and client?
b) The same interface will be shared between both sides? If not, how client side can do relation with the server side?
Thanks.
|
Hi sam detweiler.
I just had time now to study and implement this thread. So Thanks a lot one more time, because you answer is really nice.
Below, my configurations to help others, if necessary:
Plugin Project 1: com.example.jazz.simplerest.common (ISimpleRestService)
[INTERFACE CODE]
[MANIFEST]
Plugin Project 2: com.example.jazz.simplerest.service (SimpleRestService)
[MANIFEST]
[INTERFACE IMPLEMENTATION CODE]
Feature Project: com.example.jazz.simplerest.service (com.example.jazz.simplerest.common, com.example.jazz.simplerest.service)
[feature.xml]
Comments
sam detweiler
commented Aug 29 '13, 6:09 p.m.
I am so glad you were able to accomplish your goal. thank you also for the feedback
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.