"[EMAIL PROTECTED]" wrote : Ok, that was a great description of the steps.
  | 
  | How about this?
  | 
  | A file is transfered to a directory local to the AdminConsole as described. 
Then the Console prepares the input properties for the template to be executed. 
Part of the input properties is the URL to the local file. When the template 
runs, it copies the file over to the deployment.
  | 
  | In the remote scenario, the only thing that changes is the intermediate 
layer that takes care of transfering the file over (locally to the remote 
machine). The other steps are the same.
  | 
  | In the template config we would have something like:
  | 
  |   | <template-config>
  |   |    ... bla bla properties
  |   |    <property name="JarURL" type="java.net.URL"/>
  |   |    ...
  |   |    <file-list>
  |   |       <file src="files"/>  <!-- deep copy this from template dir -->
  |   |       <file src="${JarURL}"/> <!-- copy the pointed resource -->
  |   |    <file-list/>
  |   | 
  | 
  | The only "problem" I see, is whenever we need to rerun the template the 
caller needs to make sure the URL is valid, i.e. the file exists so it can be 
copied.

To solve the problem you describe how about not using a .sar to hold the 
-ds.xml and the driver .jar but instead use a -service.xml with an embedded 
classpath element and just copy the driver jar straight into a 
DeploymentService controlled directory. I think there are three scenarios of 
interest:

A) Create a new datasource:
1) A file is transfered to a directory local to the AdminConsole as described. 
2) Then the Console prepares the input properties for the template to be 
executed. Part of the input properties is the URL to the local file.
3) When the template runs, it copies the file specified by JarURL into 
./deploymentservice/datasource_jars/. Then it creates a -service.xml and copies 
it into ./deploy/deploymentservice/ making sure to include a classpath element 
which points to the driver jar in ./deploymentservice/datasource_jars/


B) Update a datasource, not changing the driver:
1) No file transfer step this time, for example we are just changing the jndi 
name
2) Then the Console prepares the input properties for the template to be 
executed. Since we don't have a URL pointing to a newly uploaded file we need 
the URL of the existing driver jar, which we can get in the following manner:
a) Call listDeployed() on MainDeployer which will return a Collection of 
DeploymentInfo objects.
b) Iterate through those finding all the ones where the URL contains 
./deploy/deploymentservice. 
c) Iterate through those finding all the ones which have MBeans whose 
ObjectNames are of the form jboss.jca:service=LocalTxCM,* or 
jboss.jca:service=TxCM,* or jboss.jca:service=??XA???.
d) Remove any DeploymentInfo objects where the package name of the 
ManagedConnectionFactory MBean does not contain "jdbc". This obviously weeds 
out JCA resources which are not Datasources.
e) This give us a list of the datasources.
f) [When the user selected a datasource to update,step 0),  they would have 
effectively selected one from this list of DeploymentInfo objects]
g) Since the selected DeploymentInfo object will correspond to a file in 
./deploy/deploymentservice/ which contains a classpath element, then the 
contents of that element should be in the classpath attribute of the 
DeploymentInfo object. 
h) We now have the contents of the classpath element which will infact point to 
the existing driver jar e.g. ./deploymentservice/datasource_jars/???.jar
3) When the template runs, it copies the file specified by JarURL into 
./deploymentservice/datasource_jars/. [This will really be copying a file onto 
itself]. Then it creates a -service.xml and copies it into 
./deploy/deploymentservice/ making sure to include a classpath element which 
points to the driver jar in ./deploymentservice/datasource_jars/


C) Update a datasource, change the driver:
This is similar to scenario A) since a new driver file will be uploaded.

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3863495#3863495

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3863495


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
JBoss-Development mailing list
JBoss-Development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to