[jboss-cvs] jbosstest/src/main/org/jboss/test/jmx/mbean ...
Anil Saldhana
anil.saldhana at jboss.com
Wed Jul 26 17:59:15 EDT 2006
User: asaldhana
Date: 06/07/26 17:59:15
Added: src/main/org/jboss/test/jmx/mbean Tag: Branch_3_2
TempFileCreatorService.java
TempFileCreatorServiceMBean.java
Log:
JBAS-3210: allow absolute url for AuthConfig resources
JBAS-3422: Do not default to conf/login-config.xml
Revision Changes Path
No revision
No revision
1.2.2.2 +61 -0 jbosstest/src/main/org/jboss/test/jmx/mbean/TempFileCreatorService.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: TempFileCreatorService.java
===================================================================
RCS file: TempFileCreatorService.java
diff -N TempFileCreatorService.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ TempFileCreatorService.java 26 Jul 2006 21:59:15 -0000 1.2.2.2
@@ -0,0 +1,61 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.jmx.mbean;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.URL;
+
+import org.jboss.logging.Logger;
+import org.jboss.system.ServiceMBeanSupport;
+
+//$Id: TempFileCreatorService.java,v 1.2.2.2 2006/07/26 21:59:15 asaldhana Exp $
+
+/**
+ * Service that creates temporary files on the server for testing purposes
+ * @author <a href="mailto:Anil.Saldhana at jboss.org">Anil Saldhana</a>
+ * @since Jun 30, 2006
+ * @version $Revision: 1.2.2.2 $
+ */
+public class TempFileCreatorService extends ServiceMBeanSupport
+implements TempFileCreatorServiceMBean
+{
+ private static Logger log = Logger.getLogger(TempFileCreatorService.class);
+
+ public TempFileCreatorService()
+ {
+ }
+
+ public URL createTempFile(String filename, String data) throws IOException
+ {
+ log.debug("Passed filename="+filename);
+ File file = File.createTempFile(filename,".xml");
+ FileWriter fw = new FileWriter(file);
+ fw.write(data);
+ fw.close();
+ file.deleteOnExit();
+ URL url = file.toURL();
+ log.debug("Temp file created="+url.toExternalForm());
+ return url;
+ }
+}
1.2.2.2 +48 -0 jbosstest/src/main/org/jboss/test/jmx/mbean/TempFileCreatorServiceMBean.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: TempFileCreatorServiceMBean.java
===================================================================
RCS file: TempFileCreatorServiceMBean.java
diff -N TempFileCreatorServiceMBean.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ TempFileCreatorServiceMBean.java 26 Jul 2006 21:59:15 -0000 1.2.2.2
@@ -0,0 +1,48 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.jmx.mbean;
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.jboss.system.ServiceMBean;
+
+//$Id: TempFileCreatorServiceMBean.java,v 1.2.2.2 2006/07/26 21:59:15 asaldhana Exp $
+
+/**
+ * MBean interface for a Temp File creator
+ * @author <a href="mailto:Anil.Saldhana at jboss.org">Anil Saldhana</a>
+ * @since Jun 30, 2006
+ * @version $Revision: 1.2.2.2 $
+ */
+public interface TempFileCreatorServiceMBean
+extends ServiceMBean
+{
+ /**
+ * Create a temporary file
+ * @param filename File Name of the temp file
+ * @param data Data to be written into the temp file
+ * @return URL of the temp file just created
+ * @throws IOException
+ */
+ public URL createTempFile(String filename, String data) throws IOException;
+}
More information about the jboss-cvs-commits
mailing list