Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Create component

Code Block
languagebash
cd ~/workspace
getTemplateForDirectory MODROOT_WS jHelloComp
cd jHelloComp/src
mkdir -p acsws/workshop/HelloComponentImpl
touch acsws/workshop/HelloComponentImpl/HelloComponentImpl.java
cp ../../idlHelloComp/src/acsws/workshop/HelloComponentImpl/HelloComponentComponentHelper.java.tpl acsws/workshop/HelloComponentImpl/HelloComponentComponentHelper.java
vim Makefile

We modify the Makefile for this component:

Code Block
languagebash
titlejHelloComp/src/Makefile
...
JARFILES = HelloComponentImpl
HelloComponentImpl_DIRS = acsws
...

We fill the component code as follows:

Code Block
languagebash
vim acsws/workshop/HelloComponentImpl/HelloComponentImpl.java
Code Block
languagepy
titlejHelloComp/src/acsws/workshop/HelloComponentImpl/HelloComponentImpl.java
//Suggested: import alma.<Module>.<Interface>Impl; //But anything, really
package acsws.workshop.HelloComponentImpl;
  
//Base component implementation, including container services and component lifecycle infrastructure
import alma.acs.component.ComponentImplBase;
  
//Skeleton interface for server implementation
import acsws.workshop.HelloComponentOperations;
 
 
//ClassName usually is <Interface>Impl, but can be anything
public class HelloComponentImpl extends ComponentImplBase implements HelloComponentOperations {
    public HelloComponentImpl() {
    }
    public String printHello() {
        System.out.println("Just printing 'Hello World!'");
        return new String("Hello World!");
    }
}

Compile component

Code Block
languagebash
make all install