Modify the Home Class
Introduction
In this step of the tutorial, the generated Home class (FilesystemHome) is modified to include an init method. The Home is used to lookup a resource instance. It can act as a factory for creating instances upon request, or build all instances. It is meant to be the entry point for locating a resource instance.
Modify the FilesytemHome Class
Open WORK_DIR/generated/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java and replace the public void init() method with the following method. You will also need to copy the instance variables below.
private static final String LVOL1_ID = "/dev/vg00/lvol1"; private static final String LVOL2_ID = "/dev/vg00/lvol2"; /** * Create and add two resource instances. * * @throws Exception on error */ public void init() throws Exception { super.init(); add( createInstance( LVOL1_ID ) ); add( createInstance( LVOL2_ID ) ); }