Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Creating a client bundle to deploy glassfish-provisioning-samples using obrhandler #13

Closed
tangyong opened this Issue · 20 comments

1 participant

@tangyong
Owner

Creating a client bundle to deploy glassfish-provisioning-samples using obrhandler.

Virtually, I should combine gf deploy command to do it, however, for the sake of simplicity, I select a client bundle to do such an experiment for obrhandler.

@tangyong tangyong was assigned
@tangyong
Owner

the client bundle will be also put into https://github.com/tangyong/glassfish-provisioning-sample

@tangyong
Owner

building a subsystem definition file for glassfish-provisioning-sample.

@tangyong
Owner

For our glassfish-provisioning-sample, Subsystem definition is as following:

<subsystems>
<subsystem name="provisioning-sample">
<repository name="provisioning-sample" uri="D:/provisioning-sample/" />
<module name="sample.glassfish.provisioning.a_api" start="false" />
<module name="sample.glassfish.provisioning.a_impl" startlevel=1 start="true" />
<module name="sample.glassfish.provisioning.b_api" start="false" />
<module name="sample.glassfish.provisioning.b_impl" startlevel=2 start="true" />
<module name="sample.glassfish.provisioning.c_api" start="false" />
<module name="sample.glassfish.provisioning.c_impl" startlevel=3 start="true" />
</subsystem>
</subsystems>

1 You must offer a subsystem name as the subsystem indentity.

2 Among the above definition, you can replace with yourself uri. You must offer a repository's name.

3 <module name="" startlevel=1 start=true> is representing bundles's starting level and how to start these bundles. If not starting some bundle, you can ignore "startlevel" attribute. In addition, module's name matches bundle-symbolicname and lately, maybe adding a version of the module to match proper module version.

@tangyong
Owner

Step1: Generate a xsd file used by jaxb

@tangyong tangyong referenced this issue from a commit
tangyong #13 generate a xsd file used by jaxb 66e03d7
@tangyong
Owner

Step1 done.

@tangyong
Owner

Step2: Using jaxb tool(xjc) to map xsd file into java object classes

xjc gfsubsystem.xsd

@tangyong
Owner

However, because generated java class uses nested classes to represent nested elements, liking org.glassfish.obrbuilder.xmlentities package, I make a split for the generated java class and re-factoring related java classes.

@tangyong
Owner

Step2 done.

@tangyong
Owner

Step3: adding a SubsystemXmlReaderWriter liking ObrXmlReaderWriter to marshall and unmarshall to and from an subsystem xml file.

@tangyong
Owner

Step3 is done

@tangyong
Owner

Step4: adding a SubsystemXmlReaderWriter reference(or dependency) into ObrHandlerServiceImpl in oder to use SubsystemXmlReaderWriter feature.

@tangyong
Owner

In addition, I must add some api to get subsystem related elements into ObrHandlerServiceImpl and ObrHandlerService

@tangyong
Owner

Adding two methods to deploy subsystem as following:

public interface ObrHandlerService {

public RepositoryAdmin getRepositoryAdmin();

public void addRepository(URI obrUri) throws Exception;

public Bundle deploy(Resource resource);

public Bundle deploy(String name, String version);

public void deploySubsystems(String subSystemPath);

public void deploySubsystem(String subSystemPath, String subSystemName);

}

@tangyong
Owner

Step5: finish the logic of deploying subsystem

@tangyong tangyong referenced this issue from a commit
tangyong #13 adding subsystem deploy core function dbc5917
@tangyong
Owner

Step 6: finish provisioning client to deploy a subsystem

@tangyong
Owner

Step 6.1: uploading a subsystem xml file

@tangyong
Owner

Step 6.2: finish client logic

@tangyong
Owner

Done and now, there is a new web provisioning client which is being done.

@tangyong tangyong closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.