/**
* Copyright 2009 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.safehaus.penrose.partition;
import org.safehaus.penrose.PenroseConfig;
import org.safehaus.penrose.naming.PenroseContext;
import org.safehaus.penrose.session.SessionManager;
import org.safehaus.penrose.session.SessionContext;
import java.io.File;
/**
* @author Endi Sukma Dewata
*/
public class PartitionContext implements Cloneable {
private File path;
private PenroseConfig penroseConfig;
private PenroseContext penroseContext;
private PartitionManager partitionManager;
private ClassLoader classLoader;
public PartitionContext() {
}
public File getPath() {
return path;
}
public void setPath(File path) {
this.path = path;
}
public PenroseConfig getPenroseConfig() {
return penroseConfig;
}
public void setPenroseConfig(PenroseConfig penroseConfig) {
this.penroseConfig = penroseConfig;
}
public PenroseContext getPenroseContext() {
return penroseContext;
}
public void setPenroseContext(PenroseContext penroseContext) {
this.penroseContext = penroseContext;
}
public ClassLoader getClassLoader() {
return classLoader;
}
public void setClassLoader(ClassLoader classLoader) {
this.classLoader = classLoader;
}
public Partition getPartition(String name) {
return penroseContext.getPartitionManager().getPartition(name);
}
public SessionManager getSessionManager() {
SessionContext sessionContext = penroseContext.getSessionContext();
return sessionContext.getSessionManager();
}
public PartitionManager getPartitionManager() {
return partitionManager;
}
public void setPartitionManager(PartitionManager partitionManager) {
this.partitionManager = partitionManager;
}
public void destroy() {
classLoader = null;
}
public Object clone() throws CloneNotSupportedException {
return super.clone();
}
}