I think that we will start using it more as time goes on.  I wanted such
a feature to allow native libs to be unloaded from a deployable archive
to then be loaded into the vm.

For the HSQL service I do not think this is needed since there aren't
any files to copy over there, the service just needs a directory to work
from.

It may make sense to simply standardize on using that for any service
that needs a local directory anyways.  I am still trying to think of an
effective way to abstract the fs thingy anyways...

--jason


On Fri, 2002-02-15 at 18:08, David Jencks wrote:
> On 2002.02.15 18:32:04 -0500 Jason Dillon wrote:
> > Could you give me a brief overview of how it works?  Or how about an
> > example for something using it already?
> > 
> > --jason
> 
> In your .sar, include a <local-directory path="hypersonic"/> element, and
> whatever is in the hypersonic directory in your sar will be copied verbatim
> to the stateDataDir, which I think used to be db;-).  If a file to be
> copied is already present it is not overwritten.  There's a test case for
> it in org.jboss.test.jmx.test.DeployServiceUnitTestCase, using
> testcopylocaldir.sar.
> 
> Marc insisted that I put this in claiming there was great demand for it but
> as far as I know no one has used it.
> 
> david jencks
> > 
> > 
> > On Fri, 2002-02-15 at 05:23, David Jencks wrote:
> > > You might want to use the "local-directory" feature of jboss-service
> > files.
> > >  This copies a directory out of a sar into (as I recall) db.  There's a
> > > test in one of the jmx tests.  I'm not sure if anyone checked that it
> > > doesn't overwrite anything already there;-)
> > > 
> > > david jencks
> > > 
> > > On 2002.02.15 03:28:39 -0500 Jason Dillon wrote:
> > > >   User: user57  
> > > >   Date: 02/02/15 00:28:39
> > > > 
> > > >   Modified:    varia/src/main/org/jboss/jdbc HypersonicDatabase.java
> > > >   Log:
> > > >    o HypersonicDatabase will now create its directory under db/ when
> > it
> > > > is
> > > >      no there.
> > > >    o not creating db/hypersonic or db/jbossmq directories from build
> > > > anymore
> > > >    o scheme.ini take a hike, unless you can find me your owner
> > > >   
> > > >   Revision  Changes    Path
> > > >   1.13      +17 -9     
>contrib/varia/src/main/org/jboss/jdbc/HypersonicDatabase.java
> > > >   
> > > >   Index: HypersonicDatabase.java
> > > >   ===================================================================
> > > >   RCS file: 
>/cvsroot/jboss/contrib/varia/src/main/org/jboss/jdbc/HypersonicDatabase.java,v
> > > >   retrieving revision 1.12
> > > >   retrieving revision 1.13
> > > >   diff -u -r1.12 -r1.13
> > > >   --- HypersonicDatabase.java   13 Feb 2002 04:26:39
> > > > -0000   1.12
> > > >   +++ HypersonicDatabase.java   15 Feb 2002 08:28:38
> > > > -0000   1.13
> > > >   @@ -8,10 +8,13 @@
> > > >    package org.jboss.jdbc;
> > > >    
> > > >    import java.io.File;
> > > >   +import java.io.IOException;
> > > >   +
> > > >    import java.sql.Connection;
> > > >    import java.sql.DriverManager;
> > > >    import java.sql.SQLException;
> > > >    import java.sql.Statement;
> > > >   +
> > > >    import javax.management.*;
> > > >    
> > > >    import org.jboss.system.ServiceMBeanSupport;
> > > >   @@ -33,7 +36,7 @@
> > > >     * @author <a href="mailto:[EMAIL PROTECTED]";>Scott
> > > > Stark</a>.
> > > >     * @author <a href="mailto:[EMAIL PROTECTED]";>Peter Fagerlund</a>
> > > >     * @author <a href="mailto:[EMAIL PROTECTED]";>Jason Dillon</a>
> > > >   - * @version $Revision: 1.12 $
> > > >   + * @version $Revision: 1.13 $
> > > >     */
> > > >    public class HypersonicDatabase 
> > > >       extends ServiceMBeanSupport 
> > > >   @@ -121,13 +124,20 @@
> > > >          }.start();
> > > >       }
> > > >    
> > > >   -   public void startService() throws Exception {
> > > >   +   protected void startService() throws Exception {
> > > >          // Get the server data directory
> > > >          File dataDir = (File)
> > > >             server.getAttribute(ServerConfigMBean.OBJECT_NAME,
> > > > "DataDir");
> > > >          
> > > >          // Get DB directory
> > > >          dbPath = new File(dataDir, "hypersonic");
> > > >   +      if (!dbPath.exists()) {
> > > >   +         dbPath.mkdirs();
> > > >   +      }
> > > >   +      if (!dbPath.isDirectory()) {
> > > >   +         throw new IOException("Failed to create directory: " +
> > > > dbPath);
> > > >   +      }
> > > >   +      
> > > >          final File prefix = new File(dbPath, name);
> > > >          
> > > >          // Start DB in new thread, or else it will block us
> > > >   @@ -160,7 +170,7 @@
> > > >        *
> > > >        * @author Peter Fagerlund [EMAIL PROTECTED] 
> > > >        */
> > > >   -   public void stopService() {
> > > >   +   protected void stopService() throws Exception {
> > > >          Connection connection;
> > > >          Statement statement;
> > > >          String cmd = "SHUTDOWN";
> > > >   @@ -178,11 +188,9 @@
> > > >          statement = connection.createStatement();
> > > >          statement.executeQuery(cmd);
> > > >          log.info("Database closed clean");
> > > >   -      } 
> > > >   -      catch (Exception e) {
> > > >   -      log.error("Failed to shutdown database", e);
> > > >   -      } 
> > > >   -      
> > > >   -      embeddedDBServer = null;
> > > >   +      }
> > > >   +      finally {
> > > >   +         embeddedDBServer = null;
> > > >   +      }
> > > >       }
> > > >    }
> > > >   
> > > >   
> > > >   
> > > > 
> > > > _______________________________________________
> > > > Jboss-development mailing list
> > > > [EMAIL PROTECTED]
> > > > https://lists.sourceforge.net/lists/listinfo/jboss-development
> > > > 
> > > > 
> > > 
> > > _______________________________________________
> > > Jboss-development mailing list
> > > [EMAIL PROTECTED]
> > > https://lists.sourceforge.net/lists/listinfo/jboss-development
> > 
> > 
> > 
> > _______________________________________________
> > Jboss-development mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/jboss-development
> > 
> > 
> 
> _______________________________________________
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development



_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to