org.jboss.console.manager
Class DeploymentFileRepository

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.console.manager.DeploymentFileRepository
All Implemented Interfaces:
DeploymentFileRepositoryMBean (src) , MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , Service (src) , ServiceMBean (src)

public class DeploymentFileRepository
extends ServiceMBeanSupport (src)
implements DeploymentFileRepositoryMBean (src)

This class wraps the file system for deployments. It gives a file-based persistence mechanism for deployments. Used by web-console to store -service.xml files, -ds.xml files, etc..., really anything text based. Deployments are tied to a specific name and that name corresponds to the base file name.


Field Summary
protected  java.io.File serverHome
          The server's home directory, for relative paths.
protected  java.net.URL serverHomeURL
           
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src)
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean (src)
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
DeploymentFileRepository()
           
 
Method Summary
 java.lang.String getBaseDir()
           
 boolean isStored(java.lang.String folder, java.lang.String name, java.lang.String fileExtension)
           
 ObjectName (src) preRegister(MBeanServer (src)  server, ObjectName (src)  name)
          Callback method of MBeanRegistration before the MBean is registered at the JMX Agent.
 void remove(java.lang.String folder, java.lang.String name, java.lang.String fileExtension)
           
 void setBaseDir(java.lang.String baseDir)
           
 void store(java.lang.String folder, java.lang.String name, java.lang.String fileExtension, java.lang.String data, boolean noHotDeploy)
           
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src)
create, createService, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, start, startService, stop, stopService
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.system.ServiceMBean (src)
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service (src)
create, destroy, start, stop
 

Field Detail

serverHome

protected java.io.File serverHome
The server's home directory, for relative paths.


serverHomeURL

protected java.net.URL serverHomeURL
Constructor Detail

DeploymentFileRepository

public DeploymentFileRepository()
Method Detail

store

public void store(java.lang.String folder,
                  java.lang.String name,
                  java.lang.String fileExtension,
                  java.lang.String data,
                  boolean noHotDeploy)
           throws java.io.IOException
Specified by:
store in interface DeploymentFileRepositoryMBean (src)
Parameters:
folder - relative directory
name - base name of file. Whitespace will be removed from name and replaced with '_'
fileExtension - must have a '.' in ext
data -
noHotDeploy - keep timestamp of file so it doesn't do a redeploy
Throws:
java.io.IOException

remove

public void remove(java.lang.String folder,
                   java.lang.String name,
                   java.lang.String fileExtension)
Specified by:
remove in interface DeploymentFileRepositoryMBean (src)

isStored

public boolean isStored(java.lang.String folder,
                        java.lang.String name,
                        java.lang.String fileExtension)
Specified by:
isStored in interface DeploymentFileRepositoryMBean (src)

getBaseDir

public java.lang.String getBaseDir()
Specified by:
getBaseDir in interface DeploymentFileRepositoryMBean (src)

setBaseDir

public void setBaseDir(java.lang.String baseDir)
Specified by:
setBaseDir in interface DeploymentFileRepositoryMBean (src)

preRegister

public ObjectName (src)  preRegister(MBeanServer (src)  server,
                              ObjectName (src)  name)
                       throws java.lang.Exception
Description copied from class: ServiceMBeanSupport (src)
Callback method of MBeanRegistration (src) before the MBean is registered at the JMX Agent.

Attention: Always call this method when you overwrite it in a subclass because it saves the Object Name of the MBean.

Specified by:
preRegister in interface MBeanRegistration (src)
Overrides:
preRegister in class ServiceMBeanSupport (src)
Parameters:
server - Reference to the JMX Agent this MBean is registered on
name - Name specified by the creator of the MBean. Note that you can overwrite it when the given ObjectName is null otherwise the change is discarded (maybe a bug in JMX-RI).
Throws:
java.lang.Exception