You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by gd...@apache.org on 2008/01/16 13:48:43 UTC
svn commit: r612439 [2/2] - in /geronimo/server/trunk:
assemblies/geronimo-jetty6-javaee5/ assemblies/geronimo-tomcat6-javaee5/
plugins/clustering/ plugins/clustering/clustering/
plugins/clustering/clustering/src/main/plan/ plugins/clustering/clusterin...
Added: geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/BasicClusterConfigurationStoreClient.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/BasicClusterConfigurationStoreClient.java?rev=612439&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/BasicClusterConfigurationStoreClient.java (added)
+++ geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/BasicClusterConfigurationStoreClient.java Wed Jan 16 04:48:37 2008
@@ -0,0 +1,235 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.farm.deployment;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.farm.config.ClusterInfo;
+import org.apache.geronimo.farm.config.ExtendedJMXConnectorInfo;
+import org.apache.geronimo.farm.config.NodeInfo;
+import org.apache.geronimo.deployment.plugin.remote.FileUploadClient;
+import org.apache.geronimo.deployment.plugin.remote.FileUploadProgress;
+import org.apache.geronimo.deployment.plugin.remote.FileUploadServletClient;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.config.ConfigurationData;
+import org.apache.geronimo.kernel.config.InvalidConfigException;
+import org.apache.geronimo.kernel.repository.Artifact;
+
+/**
+ *
+ * @version $Rev:$ $Date:$
+ */
+public class BasicClusterConfigurationStoreClient implements ClusterConfigurationStoreClient {
+ private static final Log log = LogFactory.getLog(BasicClusterConfigurationStoreClient.class);
+
+ private static final String[] METHOD_SIGNATURE_INSTALL =
+ new String[] {ConfigurationData.class.getName(), File.class.getName()};
+ private static final String[] METHOD_SIGNATURE_UNINSTALL = new String[] {Artifact.class.getName()};
+
+ private final AbstractNameQuery clusterConfigurationStoreNameQuery;
+ private final DirectoryPackager packager;
+ private final FileUploadClient fileUploadClient;
+
+ public BasicClusterConfigurationStoreClient(AbstractNameQuery clusterConfigurationStoreNameQuery) {
+ if (null == clusterConfigurationStoreNameQuery) {
+ throw new IllegalArgumentException("clusterConfigurationStoreNameQuery is required");
+ }
+ this.clusterConfigurationStoreNameQuery = clusterConfigurationStoreNameQuery;
+
+ packager = newDirectoryPackager();
+ fileUploadClient = newFileUploadClient();
+ }
+
+ public void install(ClusterInfo clusterInfo, ConfigurationData configurationData)
+ throws IOException, InvalidConfigException {
+ Collection<NodeInfo> nodeInfos = clusterInfo.getNodeInfos();
+
+ Collection<NodeInfo> installedToNodeInfos = new ArrayList<NodeInfo>();
+ for (NodeInfo nodeInfo : nodeInfos) {
+ try {
+ install(nodeInfo, configurationData);
+ installedToNodeInfos.add(nodeInfo);
+ } catch (Exception e) {
+ uninstall(clusterInfo, configurationData.getId(), installedToNodeInfos);
+ if (e instanceof IOException) {
+ throw (IOException) e;
+ } else if (e instanceof InvalidConfigException) {
+ throw (InvalidConfigException) e;
+ }
+ throw (IOException) new IOException("See nested").initCause(e);
+ }
+ }
+ }
+
+ public void uninstall(ClusterInfo clusterInfo, Artifact configId) {
+ uninstall(clusterInfo, configId, clusterInfo.getNodeInfos());
+ }
+
+ protected void uninstall(ClusterInfo clusterInfo, Artifact configId, Collection<NodeInfo> installedToNodeInfos) {
+ for (NodeInfo nodeInfo : installedToNodeInfos) {
+ try {
+ uninstall(nodeInfo, configId);
+ } catch (Exception e) {
+ log.info("Ignoring error while uninstalling [" + configId + "]from [" + nodeInfo + "]", e);
+ }
+ }
+ }
+
+ protected void install(NodeInfo nodeInfo, ConfigurationData configurationData) throws IOException {
+ Kernel kernel = nodeInfo.newKernel();
+
+ AbstractName clusterConfigurationStoreName = searchClusterConfigurationStore(kernel);
+
+ File configurationDataFile = uploadConfiguration(kernel, nodeInfo, configurationData);
+
+ boolean inVMCall = nodeInfo.getConnectorInfo().isLocal();
+ File oldConfigurationDir = null;
+ if (inVMCall) {
+ oldConfigurationDir = configurationData.getConfigurationDir();
+ }
+ Object[] params = new Object[] {configurationData, configurationDataFile};
+ try {
+ kernel.invoke(clusterConfigurationStoreName, "install", params, METHOD_SIGNATURE_INSTALL);
+ } catch (Exception e) {
+ throw (IOException) new IOException("See nested").initCause(e);
+ } finally {
+ if (inVMCall) {
+ configurationData.setConfigurationDir(oldConfigurationDir);
+ }
+ }
+ }
+
+ protected void uninstall(NodeInfo nodeInfo, Artifact configId) throws IOException {
+ Kernel kernel = nodeInfo.newKernel();
+
+ AbstractName clusterConfigurationStoreName = searchClusterConfigurationStore(kernel);
+
+ Object[] params = new Object[] {configId};
+ try {
+ kernel.invoke(clusterConfigurationStoreName, "uninstall", params, METHOD_SIGNATURE_UNINSTALL);
+ } catch (Exception e) {
+ throw (IOException) new IOException("See nested").initCause(e);
+ }
+ }
+
+ protected File uploadConfiguration(Kernel kernel, NodeInfo nodeInfo, ConfigurationData configurationData) throws IOException {
+ File packedConfigurationDir = packager.pack(configurationData.getConfigurationDir());
+
+ if (nodeInfo.getConnectorInfo().isLocal()) {
+ return packedConfigurationDir;
+ }
+
+ URL remoteDeployUploadURL = fileUploadClient.getRemoteDeployUploadURL(kernel);
+
+ ConfigurationUploadProgress configurationUploadProgress = new ConfigurationUploadProgress(configurationData);
+ File[] configurationDataFiles = new File[] {packedConfigurationDir};
+ ExtendedJMXConnectorInfo connectorInfo = nodeInfo.getConnectorInfo();
+ fileUploadClient.uploadFilesToServer(remoteDeployUploadURL,
+ connectorInfo.getUsername(),
+ connectorInfo.getPassword(),
+ configurationDataFiles,
+ configurationUploadProgress);
+
+ if (configurationUploadProgress.failure) {
+ if (null != configurationUploadProgress.exception) {
+ throw (IOException) new IOException("See nested").initCause(configurationUploadProgress.exception);
+ }
+ throw new IOException(configurationUploadProgress.failureMessage);
+ }
+
+ return configurationDataFiles[0];
+ }
+
+ protected DirectoryPackager newDirectoryPackager() {
+ return new ZipDirectoryPackager();
+ }
+
+ protected FileUploadClient newFileUploadClient() {
+ return new FileUploadServletClient();
+ }
+
+ protected AbstractName searchClusterConfigurationStore(Kernel kernel) throws IOException {
+ Set<AbstractName> clusterConfigurationStoreNames = kernel.listGBeans(clusterConfigurationStoreNameQuery);
+ if (1 != clusterConfigurationStoreNames.size()) {
+ throw new IOException("Cannot locate remote store. Found [" + clusterConfigurationStoreNames + "]");
+ }
+ return clusterConfigurationStoreNames.iterator().next();
+ }
+
+ protected class ConfigurationUploadProgress implements FileUploadProgress {
+ private final ConfigurationData configurationData;
+ private boolean failure;
+ private Exception exception;
+ private String failureMessage;
+
+ public ConfigurationUploadProgress(ConfigurationData configurationData) {
+ this.configurationData = configurationData;
+ }
+
+ public void fail(String message) {
+ failure = true;
+ failureMessage = "Upload of configuration [" + configurationData.getId() + "] - [" + message + "]";
+ log.error("Upload of configuration [" + configurationData.getId() + "] - [" + message + "]");
+ }
+
+ public void fail(Exception exception) {
+ failure = true;
+ this.exception = exception;
+ log.error("Upload of configuration [" + configurationData.getId() + "]", exception);
+ }
+
+ public void updateStatus(String message) {
+ log.info("Upload of configuration [" + configurationData.getId() + "] - [" + message + "]");
+ }
+ }
+
+ public static final GBeanInfo GBEAN_INFO;
+
+ public static final String GBEAN_J2EE_TYPE = "ClusterConfigurationStoreClient";
+ public static final String GBEAN_ATTR_CLUSTER_CONF_STORE_NAME_QUERY = "clusterConfigurationStoreNameQuery";
+
+ static {
+ GBeanInfoBuilder builder = GBeanInfoBuilder.createStatic(BasicClusterConfigurationStoreClient.class, GBEAN_J2EE_TYPE);
+
+ builder.addAttribute(GBEAN_ATTR_CLUSTER_CONF_STORE_NAME_QUERY, AbstractNameQuery.class, true);
+
+ builder.addInterface(ClusterConfigurationStoreClient.class);
+
+ builder.setConstructor(new String[]{GBEAN_ATTR_CLUSTER_CONF_STORE_NAME_QUERY});
+
+ GBEAN_INFO = builder.getBeanInfo();
+ }
+
+ public static GBeanInfo getGBeanInfo() {
+ return GBEAN_INFO;
+ }
+
+}
Added: geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/BasicSlaveConfigurationNameBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/BasicSlaveConfigurationNameBuilder.java?rev=612439&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/BasicSlaveConfigurationNameBuilder.java (added)
+++ geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/BasicSlaveConfigurationNameBuilder.java Wed Jan 16 04:48:37 2008
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.farm.deployment;
+
+import org.apache.geronimo.kernel.repository.Artifact;
+
+/**
+ *
+ * @version $Rev:$ $Date:$
+ */
+public class BasicSlaveConfigurationNameBuilder implements SlaveConfigurationNameBuilder {
+ private static final String ARTIFACT_SUFFIX = "_G_SLAVE";
+
+ public Artifact buildSlaveConfigurationName(Artifact configId) {
+ return new Artifact(configId.getGroupId(),
+ configId.getArtifactId() + ARTIFACT_SUFFIX,
+ configId.getVersion(),
+ configId.getType());
+ }
+
+ public boolean isSlaveConfigurationName(Artifact configId) {
+ return configId.getArtifactId().endsWith(ARTIFACT_SUFFIX);
+ }
+
+}
Added: geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/ClusterConfigurationController.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/ClusterConfigurationController.java?rev=612439&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/ClusterConfigurationController.java (added)
+++ geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/ClusterConfigurationController.java Wed Jan 16 04:48:37 2008
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.farm.deployment;
+
+/**
+*
+* @version $Rev:$ $Date:$
+*/
+public interface ClusterConfigurationController {
+ void startConfiguration() throws Exception;
+
+ void stopConfiguration() throws Exception;
+}
\ No newline at end of file
Added: geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/ClusterConfigurationStore.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/ClusterConfigurationStore.java?rev=612439&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/ClusterConfigurationStore.java (added)
+++ geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/ClusterConfigurationStore.java Wed Jan 16 04:48:37 2008
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.farm.deployment;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.geronimo.kernel.config.ConfigurationData;
+import org.apache.geronimo.kernel.config.InvalidConfigException;
+import org.apache.geronimo.kernel.config.NoSuchConfigException;
+import org.apache.geronimo.kernel.repository.Artifact;
+
+/**
+ *
+ * @version $Rev:$ $Date:$
+ */
+public interface ClusterConfigurationStore {
+ void install(ConfigurationData configurationData, File packedConfigurationDir) throws IOException, InvalidConfigException;
+
+ void uninstall(Artifact configId) throws NoSuchConfigException, IOException;
+}
Added: geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/ClusterConfigurationStoreClient.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/ClusterConfigurationStoreClient.java?rev=612439&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/ClusterConfigurationStoreClient.java (added)
+++ geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/ClusterConfigurationStoreClient.java Wed Jan 16 04:48:37 2008
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.farm.deployment;
+
+import java.io.IOException;
+
+import org.apache.geronimo.farm.config.ClusterInfo;
+import org.apache.geronimo.kernel.config.ConfigurationData;
+import org.apache.geronimo.kernel.config.InvalidConfigException;
+import org.apache.geronimo.kernel.repository.Artifact;
+
+/**
+ *
+ * @version $Rev:$ $Date:$
+ */
+public interface ClusterConfigurationStoreClient {
+ void install(ClusterInfo clusterInfo, ConfigurationData configurationData) throws IOException, InvalidConfigException;
+
+ void uninstall(ClusterInfo clusterInfo, Artifact configId);
+}
Added: geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/DirectoryPackager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/DirectoryPackager.java?rev=612439&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/DirectoryPackager.java (added)
+++ geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/DirectoryPackager.java Wed Jan 16 04:48:37 2008
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.farm.deployment;
+
+import java.io.File;
+import java.io.IOException;
+
+/**
+ *
+ * @version $Rev:$ $Date:$
+ */
+public interface DirectoryPackager {
+ File pack(File configurationDir) throws IOException;
+
+ File unpack(File packedConfigurationDir) throws IOException;
+
+ void unpack(File targetDir, File packedConfigurationDir) throws IOException;
+}
Added: geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/MasterConfigurationStore.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/MasterConfigurationStore.java?rev=612439&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/MasterConfigurationStore.java (added)
+++ geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/MasterConfigurationStore.java Wed Jan 16 04:48:37 2008
@@ -0,0 +1,324 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.farm.deployment;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.farm.config.ClusterInfo;
+import org.apache.geronimo.farm.config.NodeInfo;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.config.ConfigurationAlreadyExistsException;
+import org.apache.geronimo.kernel.config.ConfigurationData;
+import org.apache.geronimo.kernel.config.ConfigurationInfo;
+import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import org.apache.geronimo.kernel.config.ConfigurationStore;
+import org.apache.geronimo.kernel.config.InvalidConfigException;
+import org.apache.geronimo.kernel.config.NoSuchConfigException;
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.kernel.repository.WritableListableRepository;
+import org.apache.geronimo.system.configuration.RepositoryConfigurationStore;
+
+/**
+ *
+ * @version $Rev:$ $Date:$
+ */
+public class MasterConfigurationStore implements ConfigurationStore {
+ private static final Log log = LogFactory.getLog(MasterConfigurationStore.class);
+
+ private final ConfigurationStore delegate;
+ private final Environment defaultEnvironment;
+ private final ClusterInfo clusterInfo;
+ private final AbstractName clusterInfoName;
+ private final ClusterConfigurationStoreClient storeDelegate;
+ private final SlaveConfigurationNameBuilder slaveConfigNameBuilder;
+
+ public MasterConfigurationStore(Kernel kernel,
+ String objectName,
+ AbstractName abstractName,
+ WritableListableRepository repository,
+ Environment defaultEnvironment,
+ ClusterInfo clusterInfo,
+ ClusterConfigurationStoreClient storeDelegate) {
+ if (null == kernel) {
+ throw new IllegalArgumentException("kernel is required");
+ } else if (null == objectName) {
+ throw new IllegalArgumentException("objectName is required");
+ } else if (null == repository) {
+ throw new IllegalArgumentException("repository is required");
+ } else if (null == defaultEnvironment) {
+ throw new IllegalArgumentException("defaultEnvironment is required");
+ } else if (null == clusterInfo) {
+ throw new IllegalArgumentException("clusterInfo is required");
+ } else if (null == storeDelegate) {
+ throw new IllegalArgumentException("storeDelegate is required");
+ }
+ this.defaultEnvironment = defaultEnvironment;
+ this.clusterInfo = clusterInfo;
+ this.storeDelegate = storeDelegate;
+
+ slaveConfigNameBuilder = newSlaveConfigurationNameBuilder();
+ clusterInfoName = kernel.getAbstractNameFor(clusterInfo);
+ delegate = newConfigurationStore(kernel, objectName, abstractName, repository);
+ }
+
+ public boolean containsConfiguration(Artifact configId) {
+ if (slaveConfigNameBuilder.isSlaveConfigurationName(configId)) {
+ return false;
+ }
+ return delegate.containsConfiguration(configId);
+ }
+
+ public File createNewConfigurationDir(Artifact configId) throws ConfigurationAlreadyExistsException {
+ Artifact slaveConfigId = slaveConfigNameBuilder.buildSlaveConfigurationName(configId);
+ return delegate.createNewConfigurationDir(slaveConfigId);
+ }
+
+ public void exportConfiguration(Artifact configId, OutputStream output) throws IOException, NoSuchConfigException {
+ ensureArtifactForMasterConfiguration(configId);
+ delegate.exportConfiguration(configId, output);
+ }
+
+ public AbstractName getAbstractName() {
+ return delegate.getAbstractName();
+ }
+
+ public String getObjectName() {
+ return delegate.getObjectName();
+ }
+
+ public void install(ConfigurationData configurationData) throws IOException, InvalidConfigException {
+ Environment environment = configurationData.getEnvironment();
+ Artifact actualConfigId = environment.getConfigId();
+ Artifact slaveConfigId = slaveConfigNameBuilder.buildSlaveConfigurationName(actualConfigId);
+ environment.setConfigId(slaveConfigId);
+
+ storeDelegate.install(clusterInfo, configurationData);
+ installSlaveConfiguration(configurationData);
+
+ environment.setConfigId(actualConfigId);
+
+ installMasterConfiguration(configurationData, slaveConfigId);
+ }
+
+ public boolean isInPlaceConfiguration(Artifact configId) throws NoSuchConfigException, IOException {
+ ensureArtifactForMasterConfiguration(configId);
+ return false;
+ }
+
+ public List<ConfigurationInfo> listConfigurations() {
+ List<ConfigurationInfo> configurationInfos = delegate.listConfigurations();
+
+ List<ConfigurationInfo> filteredConfigurationInfos = new ArrayList<ConfigurationInfo>();
+ for (ConfigurationInfo configurationInfo : configurationInfos) {
+ if (!slaveConfigNameBuilder.isSlaveConfigurationName(configurationInfo.getConfigID())) {
+ filteredConfigurationInfos.add(configurationInfo);
+ }
+ }
+
+ return filteredConfigurationInfos;
+ }
+
+ public ConfigurationData loadConfiguration(Artifact configId)
+ throws NoSuchConfigException, IOException, InvalidConfigException {
+ ensureArtifactForMasterConfiguration(configId);
+ return delegate.loadConfiguration(configId);
+ }
+
+ public Set<URL> resolve(Artifact configId, String moduleName, String path)
+ throws NoSuchConfigException, MalformedURLException {
+ ensureArtifactForMasterConfiguration(configId);
+ return delegate.resolve(configId, moduleName, path);
+ }
+
+ public void uninstall(Artifact configId) throws NoSuchConfigException, IOException {
+ ensureArtifactForMasterConfiguration(configId);
+
+ Artifact slaveConfigId = slaveConfigNameBuilder.buildSlaveConfigurationName(configId);
+ storeDelegate.uninstall(clusterInfo, slaveConfigId);
+
+ try {
+ delegate.uninstall(slaveConfigId);
+ } catch (Exception e) {
+ log.warn("Exception when uninstalling [" + slaveConfigId + "]", e);
+ }
+ delegate.uninstall(configId);
+ }
+
+ protected void ensureArtifactForMasterConfiguration(Artifact configId) throws NoSuchConfigException {
+ if (slaveConfigNameBuilder.isSlaveConfigurationName(configId)) {
+ throw new NoSuchConfigException(configId);
+ }
+ }
+
+ protected ConfigurationStore newConfigurationStore(Kernel kernel,
+ String objectName,
+ AbstractName abstractName,
+ WritableListableRepository repository) {
+ return new RepositoryConfigurationStore(kernel, objectName, abstractName, repository);
+ }
+
+ protected SlaveConfigurationNameBuilder newSlaveConfigurationNameBuilder() {
+ return new BasicSlaveConfigurationNameBuilder();
+ }
+
+ protected void installMasterConfiguration(ConfigurationData configurationData, Artifact slaveConfigId)
+ throws IOException, InvalidConfigException {
+ ConfigurationData masterConfigurationData = buildMasterConfigurationData(configurationData, slaveConfigId);
+ try {
+ delegate.install(masterConfigurationData);
+ } catch (Exception e) {
+ storeDelegate.uninstall(clusterInfo, slaveConfigId);
+ try {
+ delegate.uninstall(slaveConfigId);
+ } catch (NoSuchConfigException nestedE) {
+ }
+ if (e instanceof IOException) {
+ throw (IOException) e;
+ } else if (e instanceof InvalidConfigException) {
+ throw (InvalidConfigException) e;
+ }
+ throw (IOException) new IOException("See nested").initCause(e);
+ }
+ }
+
+ protected void installSlaveConfiguration(ConfigurationData configurationData)
+ throws IOException, InvalidConfigException {
+ try {
+ delegate.install(configurationData);
+ } catch (Exception e) {
+ storeDelegate.uninstall(clusterInfo, configurationData.getId());
+ if (e instanceof IOException) {
+ throw (IOException) e;
+ } else if (e instanceof InvalidConfigException) {
+ throw (InvalidConfigException) e;
+ }
+ throw (IOException) new IOException("See nested").initCause(e);
+ }
+ }
+
+ protected ConfigurationData buildMasterConfigurationData(ConfigurationData configurationData,
+ Artifact slaveConfigId) {
+ Environment environment = buildEnvironment(configurationData);
+
+ Artifact configId = environment.getConfigId();
+
+ List<GBeanData> gbeans = buildControllerGBeans(configId, slaveConfigId);
+
+ File configurationDir = delegate.createNewConfigurationDir(configId);
+
+ return new ConfigurationData(ConfigurationModuleType.CAR,
+ new LinkedHashSet(),
+ gbeans,
+ Collections.EMPTY_MAP,
+ environment,
+ configurationDir,
+ null,
+ configurationData.getNaming());
+ }
+
+ protected Environment buildEnvironment(ConfigurationData configurationData) {
+ Environment environment = new Environment(defaultEnvironment);
+ environment.setConfigId(configurationData.getId());
+ return environment;
+ }
+
+ protected List<GBeanData> buildControllerGBeans(Artifact configId, Artifact slaveConfigId) {
+ List<GBeanData> gbeans = new ArrayList<GBeanData>();
+ for (NodeInfo nodeInfo : clusterInfo.getNodeInfos()) {
+ GBeanData gbean = buildControllerGBean(configId, nodeInfo, slaveConfigId);
+ gbeans.add(gbean);
+ }
+ return gbeans;
+ }
+
+ protected GBeanData buildControllerGBean(Artifact configId, NodeInfo nodeInfo, Artifact slaveConfigId) {
+ AbstractName controllerName = buildControllerName(configId, nodeInfo);
+
+ GBeanData gbean = new GBeanData(controllerName, BasicClusterConfigurationController.GBEAN_INFO);
+ gbean.setAttribute(BasicClusterConfigurationController.GBEAN_ATTR_ARTIFACT, slaveConfigId);
+ gbean.setAttribute(BasicClusterConfigurationController.GBEAN_ATTR_IGNORE_START_CONF_FAIL_UPON_START,
+ Boolean.TRUE);
+ gbean.setAttribute(BasicClusterConfigurationController.GBEAN_ATTR_NODE_NAME, nodeInfo.getName());
+ gbean.setAttribute(BasicClusterConfigurationController.GBEAN_ATTR_START_CONF_UPON_START, Boolean.TRUE);
+ gbean.setReferencePattern(BasicClusterConfigurationController.GBEAN_REF_CLUSTER_INFO, clusterInfoName);
+ return gbean;
+ }
+
+ protected AbstractName buildControllerName(Artifact configId,
+ NodeInfo nodeInfo) {
+ return new AbstractName(configId, Collections.singletonMap("nodeName", nodeInfo.getName()));
+ }
+
+ public static final GBeanInfo GBEAN_INFO;
+
+ public static final String GBEAN_J2EE_TYPE = "ConfigurationStore";
+ public static final String GBEAN_ATTR_KERNEL = "kernel";
+ public static final String GBEAN_ATTR_OBJECT_NAME = "objectName";
+ public static final String GBEAN_ATTR_DEFAULT_ENV = "defaultEnvironment";
+ public static final String GBEAN_REF_REPOSITORY = "Repository";
+ public static final String GBEAN_REF_CLUSTER_INFO = "ClusterInfo";
+ public static final String GBEAN_REF_CLUSTER_CONF_STORE_CLIENT = "ClusterConfigurationStoreClient";
+
+ static {
+ GBeanInfoBuilder builder = GBeanInfoBuilder.createStatic(MasterConfigurationStore.class, GBEAN_J2EE_TYPE);
+
+ builder.addAttribute(GBEAN_ATTR_KERNEL, Kernel.class, false);
+ builder.addAttribute(GBEAN_ATTR_OBJECT_NAME, String.class, false);
+ builder.addAttribute("abstractName", AbstractName.class, false);
+ builder.addAttribute(GBEAN_ATTR_DEFAULT_ENV, Environment.class, true, true);
+
+ builder.addReference(GBEAN_REF_REPOSITORY, WritableListableRepository.class, "Repository");
+ builder.addReference(GBEAN_REF_CLUSTER_INFO, ClusterInfo.class);
+ builder.addReference(GBEAN_REF_CLUSTER_CONF_STORE_CLIENT, ClusterConfigurationStoreClient.class);
+
+ builder.addInterface(ConfigurationStore.class);
+
+ builder.setConstructor(new String[]{GBEAN_ATTR_KERNEL,
+ GBEAN_ATTR_OBJECT_NAME,
+ "abstractName",
+ GBEAN_REF_REPOSITORY,
+ GBEAN_ATTR_DEFAULT_ENV,
+ GBEAN_REF_CLUSTER_INFO,
+ GBEAN_REF_CLUSTER_CONF_STORE_CLIENT});
+
+ GBEAN_INFO = builder.getBeanInfo();
+ }
+
+ public static GBeanInfo getGBeanInfo() {
+ return GBEAN_INFO;
+ }
+
+}
Added: geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/SlaveConfigurationNameBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/SlaveConfigurationNameBuilder.java?rev=612439&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/SlaveConfigurationNameBuilder.java (added)
+++ geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/SlaveConfigurationNameBuilder.java Wed Jan 16 04:48:37 2008
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.farm.deployment;
+
+import org.apache.geronimo.kernel.repository.Artifact;
+
+/**
+ *
+ * @version $Rev:$ $Date:$
+ */
+public interface SlaveConfigurationNameBuilder {
+ Artifact buildSlaveConfigurationName(Artifact configId);
+
+ boolean isSlaveConfigurationName(Artifact configId);
+}
Added: geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/ZipDirectoryPackager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/ZipDirectoryPackager.java?rev=612439&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/ZipDirectoryPackager.java (added)
+++ geronimo/server/trunk/plugins/clustering/geronimo-farm/src/main/java/org/apache/geronimo/farm/deployment/ZipDirectoryPackager.java Wed Jan 16 04:48:37 2008
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.farm.deployment;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Enumeration;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+import java.util.zip.ZipOutputStream;
+
+/**
+ *
+ * @version $Rev:$ $Date:$
+ */
+public class ZipDirectoryPackager implements DirectoryPackager {
+
+ public File pack(File configurationDir) throws IOException {
+ File zippedDir = File.createTempFile(configurationDir.getName(), ".zip");
+
+ OutputStream out = new FileOutputStream(zippedDir);
+ out = new BufferedOutputStream(out);
+ ZipOutputStream zos = new ZipOutputStream(out);
+ zip(zos, configurationDir, configurationDir);
+ zos.close();
+
+ return zippedDir;
+ }
+
+ public File unpack(File packedConfigurationDir) throws IOException {
+ String tmpDirAsString = System.getProperty("java.io.tmpdir");
+ File targetDir = new File(new File(tmpDirAsString), packedConfigurationDir.getName() + "_unpack");
+ unpack(targetDir, packedConfigurationDir);
+ return targetDir;
+ }
+
+ public void unpack(File targetDir, File packedConfigurationDir) throws IOException {
+ ZipFile zipFile = new ZipFile(packedConfigurationDir);
+ Enumeration<? extends ZipEntry> zipEntries = zipFile.entries();
+ while (zipEntries.hasMoreElements()) {
+ ZipEntry zipEntry = zipEntries.nextElement();
+ File targetFile = new File(targetDir, zipEntry.getName());
+
+ if (zipEntry.isDirectory()) {
+ targetFile.mkdirs();
+ } else {
+ targetFile.getParentFile().mkdirs();
+ targetFile.createNewFile();
+ OutputStream out = new FileOutputStream(targetFile);
+ out = new BufferedOutputStream(out);
+ InputStream in = zipFile.getInputStream(zipEntry);
+
+ byte[] buffer = new byte[1024];
+ int read;
+ while (-1 != (read = in.read(buffer))) {
+ out.write(buffer, 0, read);
+ }
+
+ in.close();
+ out.close();
+ }
+ }
+ }
+
+ protected void zip(ZipOutputStream zos, File configurationDir, File nestedFile) throws IOException {
+ if (nestedFile.isDirectory()) {
+ File[] nestedFiles = nestedFile.listFiles();
+ for (int i = 0; i < nestedFiles.length; i++) {
+ zip(zos, configurationDir, nestedFiles[i]);
+ }
+ } else {
+ String nestedFilePath = nestedFile.getAbsolutePath();
+ String zipEntryName = nestedFilePath.substring(configurationDir.getAbsolutePath().length() + 1, nestedFilePath.length());
+ ZipEntry zipEntry = new ZipEntry(zipEntryName);
+ zos.putNextEntry(zipEntry);
+
+ InputStream in = new FileInputStream(nestedFile);
+ in = new BufferedInputStream(in);
+
+ byte[] buffer = new byte[1024];
+ int read;
+ while (-1 != (read = in.read(buffer))) {
+ zos.write(buffer, 0, read);
+ }
+
+ in.close();
+ zos.closeEntry();
+ }
+ }
+
+}
Copied: geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/java/org/apache/geronimo/farm/deployment/BasicClusterConfigurationControllerTest.java (from r612336, geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/test/java/org/apache/geronimo/clustering/deployment/BasicClusterConfigurationControllerTest.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/java/org/apache/geronimo/farm/deployment/BasicClusterConfigurationControllerTest.java?p2=geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/java/org/apache/geronimo/farm/deployment/BasicClusterConfigurationControllerTest.java&p1=geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/test/java/org/apache/geronimo/clustering/deployment/BasicClusterConfigurationControllerTest.java&r1=612336&r2=612439&rev=612439&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/test/java/org/apache/geronimo/clustering/deployment/BasicClusterConfigurationControllerTest.java (original)
+++ geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/java/org/apache/geronimo/farm/deployment/BasicClusterConfigurationControllerTest.java Wed Jan 16 04:48:37 2008
@@ -17,13 +17,13 @@
* under the License.
*/
-package org.apache.geronimo.clustering.deployment;
+package org.apache.geronimo.farm.deployment;
import java.util.ArrayList;
import java.util.Collection;
-import org.apache.geronimo.clustering.config.ClusterInfo;
-import org.apache.geronimo.clustering.config.NodeInfo;
+import org.apache.geronimo.farm.config.ClusterInfo;
+import org.apache.geronimo.farm.config.NodeInfo;
import org.apache.geronimo.kernel.Kernel;
import org.apache.geronimo.kernel.config.ConfigurationManager;
import org.apache.geronimo.kernel.config.NoSuchConfigException;
Copied: geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/java/org/apache/geronimo/farm/deployment/BasicClusterConfigurationStoreClientTest.java (from r612336, geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/test/java/org/apache/geronimo/clustering/deployment/BasicClusterConfigurationStoreClientTest.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/java/org/apache/geronimo/farm/deployment/BasicClusterConfigurationStoreClientTest.java?p2=geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/java/org/apache/geronimo/farm/deployment/BasicClusterConfigurationStoreClientTest.java&p1=geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/test/java/org/apache/geronimo/clustering/deployment/BasicClusterConfigurationStoreClientTest.java&r1=612336&r2=612439&rev=612439&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/test/java/org/apache/geronimo/clustering/deployment/BasicClusterConfigurationStoreClientTest.java (original)
+++ geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/java/org/apache/geronimo/farm/deployment/BasicClusterConfigurationStoreClientTest.java Wed Jan 16 04:48:37 2008
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.geronimo.clustering.deployment;
+package org.apache.geronimo.farm.deployment;
import java.io.File;
import java.io.IOException;
@@ -28,9 +28,9 @@
import java.util.Collections;
import java.util.Set;
-import org.apache.geronimo.clustering.config.ClusterInfo;
-import org.apache.geronimo.clustering.config.ExtendedJMXConnectorInfo;
-import org.apache.geronimo.clustering.config.NodeInfo;
+import org.apache.geronimo.farm.config.ClusterInfo;
+import org.apache.geronimo.farm.config.ExtendedJMXConnectorInfo;
+import org.apache.geronimo.farm.config.NodeInfo;
import org.apache.geronimo.deployment.plugin.remote.FileUploadClient;
import org.apache.geronimo.deployment.plugin.remote.FileUploadProgress;
import org.apache.geronimo.gbean.AbstractName;
Copied: geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/java/org/apache/geronimo/farm/deployment/BasicClusterConfigurationStoreTest.java (from r612336, geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/test/java/org/apache/geronimo/clustering/deployment/BasicClusterConfigurationStoreTest.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/java/org/apache/geronimo/farm/deployment/BasicClusterConfigurationStoreTest.java?p2=geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/java/org/apache/geronimo/farm/deployment/BasicClusterConfigurationStoreTest.java&p1=geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/test/java/org/apache/geronimo/clustering/deployment/BasicClusterConfigurationStoreTest.java&r1=612336&r2=612439&rev=612439&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/test/java/org/apache/geronimo/clustering/deployment/BasicClusterConfigurationStoreTest.java (original)
+++ geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/java/org/apache/geronimo/farm/deployment/BasicClusterConfigurationStoreTest.java Wed Jan 16 04:48:37 2008
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.geronimo.clustering.deployment;
+package org.apache.geronimo.farm.deployment;
import java.io.File;
import java.io.IOException;
Copied: geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/java/org/apache/geronimo/farm/deployment/BasicMasterConfigurationNameBuilderTest.java (from r612336, geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/test/java/org/apache/geronimo/clustering/deployment/BasicMasterConfigurationNameBuilderTest.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/java/org/apache/geronimo/farm/deployment/BasicMasterConfigurationNameBuilderTest.java?p2=geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/java/org/apache/geronimo/farm/deployment/BasicMasterConfigurationNameBuilderTest.java&p1=geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/test/java/org/apache/geronimo/clustering/deployment/BasicMasterConfigurationNameBuilderTest.java&r1=612336&r2=612439&rev=612439&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/test/java/org/apache/geronimo/clustering/deployment/BasicMasterConfigurationNameBuilderTest.java (original)
+++ geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/java/org/apache/geronimo/farm/deployment/BasicMasterConfigurationNameBuilderTest.java Wed Jan 16 04:48:37 2008
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.geronimo.clustering.deployment;
+package org.apache.geronimo.farm.deployment;
import org.apache.geronimo.kernel.repository.Artifact;
Copied: geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/java/org/apache/geronimo/farm/deployment/MasterConfigurationStoreTest.java (from r612336, geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/test/java/org/apache/geronimo/clustering/deployment/MasterConfigurationStoreTest.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/java/org/apache/geronimo/farm/deployment/MasterConfigurationStoreTest.java?p2=geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/java/org/apache/geronimo/farm/deployment/MasterConfigurationStoreTest.java&p1=geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/test/java/org/apache/geronimo/clustering/deployment/MasterConfigurationStoreTest.java&r1=612336&r2=612439&rev=612439&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/test/java/org/apache/geronimo/clustering/deployment/MasterConfigurationStoreTest.java (original)
+++ geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/java/org/apache/geronimo/farm/deployment/MasterConfigurationStoreTest.java Wed Jan 16 04:48:37 2008
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.geronimo.clustering.deployment;
+package org.apache.geronimo.farm.deployment;
import java.io.ByteArrayOutputStream;
import java.io.File;
@@ -30,8 +30,8 @@
import junit.framework.AssertionFailedError;
-import org.apache.geronimo.clustering.config.ClusterInfo;
-import org.apache.geronimo.clustering.config.NodeInfo;
+import org.apache.geronimo.farm.config.ClusterInfo;
+import org.apache.geronimo.farm.config.NodeInfo;
import org.apache.geronimo.gbean.AbstractName;
import org.apache.geronimo.gbean.GBeanData;
import org.apache.geronimo.kernel.Jsr77Naming;
Copied: geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/java/org/apache/geronimo/farm/deployment/ZipDirectoryPackagerTest.java (from r612336, geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/test/java/org/apache/geronimo/clustering/deployment/ZipDirectoryPackagerTest.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/java/org/apache/geronimo/farm/deployment/ZipDirectoryPackagerTest.java?p2=geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/java/org/apache/geronimo/farm/deployment/ZipDirectoryPackagerTest.java&p1=geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/test/java/org/apache/geronimo/clustering/deployment/ZipDirectoryPackagerTest.java&r1=612336&r2=612439&rev=612439&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/test/java/org/apache/geronimo/clustering/deployment/ZipDirectoryPackagerTest.java (original)
+++ geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/java/org/apache/geronimo/farm/deployment/ZipDirectoryPackagerTest.java Wed Jan 16 04:48:37 2008
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.geronimo.clustering.deployment;
+package org.apache.geronimo.farm.deployment;
import java.io.BufferedReader;
import java.io.File;
Added: geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/resources/folderToZip/folder1/file1
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/resources/folderToZip/folder1/file1?rev=612439&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/resources/folderToZip/folder1/file1 (added)
+++ geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/resources/folderToZip/folder1/file1 Wed Jan 16 04:48:37 2008
@@ -0,0 +1 @@
+folder1/file1
\ No newline at end of file
Added: geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/resources/folderToZip/folder1/file2
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/resources/folderToZip/folder1/file2?rev=612439&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/resources/folderToZip/folder1/file2 (added)
+++ geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/resources/folderToZip/folder1/file2 Wed Jan 16 04:48:37 2008
@@ -0,0 +1 @@
+folder1/file2
\ No newline at end of file
Added: geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/resources/folderToZip/folder2/file1
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/resources/folderToZip/folder2/file1?rev=612439&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/resources/folderToZip/folder2/file1 (added)
+++ geronimo/server/trunk/plugins/clustering/geronimo-farm/src/test/resources/folderToZip/folder2/file1 Wed Jan 16 04:48:37 2008
@@ -0,0 +1 @@
+folder2/file1
\ No newline at end of file
Modified: geronimo/server/trunk/plugins/clustering/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/clustering/pom.xml?rev=612439&r1=612438&r2=612439&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/clustering/pom.xml (original)
+++ geronimo/server/trunk/plugins/clustering/pom.xml Wed Jan 16 04:48:37 2008
@@ -31,9 +31,11 @@
clustering plugin
</description>
<modules>
- <module>clustering</module>
<module>geronimo-clustering</module>
<module>geronimo-clustering-wadi</module>
+ <module>geronimo-farm</module>
+ <module>clustering</module>
<module>wadi-clustering</module>
+ <module>farming</module>
</modules>
</project>