Author: indika Date: Sun Jun 1 09:03:02 2008 New Revision: 17736 URL: http://wso2.org/svn/browse/wso2?view=rev&revision=17736
Log: Updates to registry 1.1 release ESB war was deployed in Jboss 4.x and worked fine synape.properties file back to conf directory Added: branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusConstants.java branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusException.java branches/esb/java/1.7/esb/java/modules/distribution/src/main/conf/registry.xml branches/esb/java/1.7/esb/java/modules/distribution/src/main/www/global_params.js Removed: branches/esb/java/1.7/esb/java/modules/startup/src/main/java/org/wso2/esb/ServiceBusConstants.java Modified: branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusConfiguration.java branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/persistence/PersistenceManager.java branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/registry/ESBRegistry.java branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/registry/RegistryAdapterFactory.java branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/registry/WSO2RegistryAdapter.java branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/services/LogAdmin.java branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/services/RegistryAdmin.java branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/services/ServiceAdmin.java branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/statistics/StatisticsReporterThread.java branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/statistics/persistence/StatisticsDBUtils.java branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/ESBServlet.java branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/HttpsTransportListener.java branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/StartUpServlet.java branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/util/XmlConfiguration.java branches/esb/java/1.7/esb/java/modules/distribution/src/main/assembly/bin.xml branches/esb/java/1.7/esb/java/modules/distribution/src/main/conf/server.xml branches/esb/java/1.7/esb/java/modules/startup/src/main/java/org/wso2/esb/TomcatServer.java branches/esb/java/1.7/esb/java/pom.xml Modified: branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusConfiguration.java URL: http://wso2.org/svn/browse/wso2/branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusConfiguration.java?rev=17736&r1=17735&r2=17736&view=diff ============================================================================== --- branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusConfiguration.java (original) +++ branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusConfiguration.java Sun Jun 1 09:03:02 2008 @@ -69,11 +69,12 @@ esbHome = System.getProperty(ServiceBusConstants.ESB_HOME); } } - + String path = esbHome + File.separator + DEF_LOCATION; + log.info("Configuration loading from : " + path); try { serverConfiguration = ServerConfiguration.getInstance(); - serverConfiguration.init(DEF_LOCATION); - log.info("Configuration loaded from : " + DEF_LOCATION); + serverConfiguration.init(path); + } catch (ServerConfigurationException e) { log.error("Error initalizing ServiceBusConfiguration using : " + DEF_LOCATION); Added: branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusConstants.java URL: http://wso2.org/svn/browse/wso2/branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusConstants.java?pathrev=17736 ============================================================================== --- (empty file) +++ branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusConstants.java Sun Jun 1 09:03:02 2008 @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2006, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * Licensed 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.wso2.esb; + +import java.net.URI; +import java.io.File; + +/* +* ServiceBusConstants use by WSO2 ESB +*/ +public final class ServiceBusConstants { + + public static final String MESSAGE_MAP_KEY = "Message_Map_Key"; + public static final String IN_MESSAGE_MAP_KEY = "IN_Message_Map_Key"; + public static final String OUT_MESSAGE_MAP_KEY = "OUT_Message_Map_Key"; + public static final String IN_FAULT_MESSAGE_MAP_KEY = "IN_FAULT_Message_Map_Key"; + public static final String OUT_FAULT_MESSAGE_MAP_KEY = "OUT_FAULT_Message_Map_Key"; + public static final String ADMIN_TRANSPORT = "admin/https"; + public static final String HTTP_TRANSPORT = "http"; + public static final String HTTPS_TRANSPORT = "https"; + + public static final String ADMIN_SERVICE_GROUP = "ESBAdmin"; + public static final String ESB_INSTANCE = "WSO2 ESB"; + public static final String ESB_XML_NAMESPACE = "http://www.wso2.org/projects/esb"; + public static final String ESB_WEB_XML_KEY = "ESB_WEB_XML_KEY"; + public static final String ESB_HOME = "esb.home"; + + public static final String WELCOME_PAGE = "INDEX_HTML_FILE"; + public static final String GENERATED_PAGES = "wso2esb.generated.pages"; + + // ServiceBusConstants for ESB registry + public static final int LOCAL_HOST_REGISTRY = 100; + public static final int REMOTE_HOST_REGISTRY = 101; + public static final int REGISTRY_MODE = LOCAL_HOST_REGISTRY; + // this will be overwritten if localRegistry parameter is set + public static final String LOCAL_REGISTRY_ROOT = "registry/"; + public static final String REGISTRY_FILE = "file"; + public static final String REGISTRY_FOLDER = "folder"; + public static final URI folder = + URI.create("http://wso2.org/projects/esb/registry/types/folder"); + // use if the exact file type is not known + public static final URI file = + URI.create("http://wso2.org/projects/esb/registry/types/file"); + + + public static final String WSO2ESB_HB_CONFIG_KEY = "wso2esb_hb_configuration_key"; + + public static final String LOG4J_PROPS = "log4j.properties"; + public static final String SERVER_XML = "server.xml"; + public static final String SERVER_NAME = "serverName"; + public static final String SYNAPSE_XML = "synapse.xml"; + public static final String RESOLVE_ROOT = "resolve.root"; + public static final String AXIS2_XML = "axis2.xml"; + public static final String AXIS2_REPO = "axis2.repo"; + public static final String ESB_SERVER_WEB_XML = "server-web.xml"; + public static final String UI_EXTENSIONS_CONFIG_XML = "conf/ui-extensions-config.xml"; + public static final String HIBERNATE_CFG_XML = "conf/wso2esb.hibernate.cfg.xml"; + public static final String ESB_CONF_DIRECTORY = "webapp" + File.separator + "WEB-INF" + File.separator + "classes" + File.separator + "conf" + File.separator; + public static final String JMX_AGENT_NAME = "jmx.agent.name"; + public static final String DEFAULT_JMX_AGENT_NAME = "org.wso2.esb"; + + public static String REGISTRY = "Registry"; + public static String USERMANAGER_CONFIG = "UsermanagerConfig"; + public static String CONFIGURATION = "configuration"; + public static String DRIVER_CLASS = "driverClass"; + public static String LOCATION= "Location"; + public static String URL = "url"; + public static String USERNAME = "username"; + public static String PASSWORD = "password"; + public static String IMPORT_ROOT = "importRoot"; + public static String TYPE = "type"; + + + public static class Logging { + public static String ESB_CONSOLE_APPENDER = "ESB_CONSOLE_APPENDER"; + public static String ESB_LOG_FILE_APPENDER = "ESB_LOG_FILE_APPENDER"; + public static String ESB_MEMORY_APPENDER = "ESB_MEMORY_APPENDER"; + } + + // ServiceBusConstants for DataBase Access + public static class DBAccess { + public static final String DERBY_NETWOEK_SERVER_DRIVER + = "org.apache.derby.jdbc.ClientDriver"; + public static final String STATISTICS_DO = "StatisticsDO"; + } +} Added: branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusException.java URL: http://wso2.org/svn/browse/wso2/branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusException.java?pathrev=17736 ============================================================================== --- (empty file) +++ branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusException.java Sun Jun 1 09:03:02 2008 @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2006, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * Licensed 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.wso2.esb; + +/* +* +*/ +public class ServiceBusException extends RuntimeException { + + private static final long serialVersionUID = 5967324819038387267L; + + public ServiceBusException() { + super(); + } + + public ServiceBusException(String message) { + super(message); + } + + public ServiceBusException(Throwable cause) { + super(cause); + } + + public ServiceBusException(String message, Throwable cause) { + super(message, cause); + } +} Modified: branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/persistence/PersistenceManager.java URL: http://wso2.org/svn/browse/wso2/branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/persistence/PersistenceManager.java?rev=17736&r1=17735&r2=17736&view=diff ============================================================================== --- branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/persistence/PersistenceManager.java (original) +++ branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/persistence/PersistenceManager.java Sun Jun 1 09:03:02 2008 @@ -21,13 +21,13 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.esb.ServiceBusConstants; import org.wso2.esb.persistence.dao.RegistryEntryDAO; import org.wso2.esb.persistence.dao.StatisticsDAO; import org.wso2.esb.persistence.dataobject.RegistryEntryDO; import org.wso2.esb.persistence.dataobject.StatisticsDO; import org.wso2.esb.util.HibernateConfig; import org.wso2.esb.util.HibernateConfigCache; +import org.wso2.esb.ServiceBusConstants; import java.util.List; Modified: branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/registry/ESBRegistry.java URL: http://wso2.org/svn/browse/wso2/branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/registry/ESBRegistry.java?rev=17736&r1=17735&r2=17736&view=diff ============================================================================== --- branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/registry/ESBRegistry.java (original) +++ branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/registry/ESBRegistry.java Sun Jun 1 09:03:02 2008 @@ -27,11 +27,10 @@ import org.apache.synapse.SynapseException; import org.apache.synapse.config.SynapseConfigUtils; import org.apache.synapse.registry.AbstractRegistry; -import org.apache.synapse.registry.Registry; import org.apache.synapse.registry.RegistryEntry; import org.apache.synapse.registry.RegistryEntryImpl; -import org.wso2.esb.ServiceBusConstants; import org.wso2.esb.ServiceBusConfiguration; +import org.wso2.esb.ServiceBusConstants; import org.wso2.esb.persistence.PersistenceManager; import org.wso2.esb.persistence.dataobject.RegistryEntryDO; import org.wso2.registry.RegistryConstants; Modified: branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/registry/RegistryAdapterFactory.java URL: http://wso2.org/svn/browse/wso2/branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/registry/RegistryAdapterFactory.java?rev=17736&r1=17735&r2=17736&view=diff ============================================================================== --- branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/registry/RegistryAdapterFactory.java (original) +++ branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/registry/RegistryAdapterFactory.java Sun Jun 1 09:03:02 2008 @@ -24,16 +24,16 @@ import org.apache.synapse.SynapseException; import org.apache.synapse.registry.Registry; import org.apache.synapse.registry.url.SimpleURLRegistry; -import org.wso2.esb.ServiceBusConstants; import org.wso2.esb.ServiceBusException; import org.wso2.esb.ServiceBusConfiguration; -import org.wso2.registry.RegistryException; +import org.wso2.esb.ServiceBusConstants; import org.wso2.registry.app.RemoteRegistry; import org.wso2.registry.jdbc.EmbeddedRegistry; import org.wso2.registry.jdbc.InMemoryEmbeddedRegistry; -import org.wso2.registry.jdbc.utils.RegistryDataSource; +import org.wso2.registry.exceptions.RegistryException; +import org.wso2.registry.config.RegistryContext; -import java.io.File; +import java.io.*; import java.net.MalformedURLException; import java.net.URL; @@ -158,37 +158,21 @@ private static org.wso2.registry.Registry createJDBCRegistry( ServiceBusConfiguration esbConfiguration) { - String registryDriverClass = esbConfiguration + String registryConf = esbConfiguration .getFirstProperty (ServiceBusConstants.REGISTRY + "." + ServiceBusConstants.CONFIGURATION + - "." + ServiceBusConstants.DRIVER_CLASS); - String registryUrl = esbConfiguration - .getFirstProperty( - ServiceBusConstants.REGISTRY + "." + - ServiceBusConstants.CONFIGURATION + - "." + ServiceBusConstants.URL); - String registryUsername = esbConfiguration - .getFirstProperty(ServiceBusConstants.REGISTRY + "." + - ServiceBusConstants.CONFIGURATION + - "." + ServiceBusConstants.USERNAME); - String registryPassword = esbConfiguration - .getFirstProperty(ServiceBusConstants.REGISTRY + "." + - ServiceBusConstants.CONFIGURATION + - "." + ServiceBusConstants.PASSWORD); - - if (registryDriverClass == null || "".equals(registryDriverClass) || - registryUrl == null || "".equals(registryUrl)) { - handleException("Cannot find DataBase connection details pertaining to " + - "the registry. The driverClass and the url are mandatory."); - } - + "." + ServiceBusConstants.LOCATION); try { + String esbHome = esbConfiguration.getEsbHome(); + if(esbHome == null){ + esbHome = "."; + } + String path = esbHome + File.separator + registryConf; - RegistryDataSource dataSource = new RegistryDataSource( - registryUrl, registryDriverClass, registryUsername, registryPassword); - - EmbeddedRegistry embeddedRegistry = new EmbeddedRegistry(dataSource); + RegistryContext registryContext = new RegistryContext( + getRegistryConfigurationAsStream(path)); + EmbeddedRegistry embeddedRegistry = registryContext.getEmbeddedRegistry(); return embeddedRegistry.getSystemRegistry(); } catch (RegistryException e) { @@ -233,6 +217,37 @@ throw new ServiceBusException(""); } + + private static InputStream getRegistryConfigurationAsStream(String path) { + + BufferedInputStream bufferedInputStream = null; + try { + + URL url = new URL(path); + bufferedInputStream = new BufferedInputStream(url.openStream()); + + } catch (MalformedURLException e) { + + File file = new File(path); + try { + bufferedInputStream = new BufferedInputStream(new FileInputStream(file)); + } catch (FileNotFoundException fnf) { + InputStream in = + RegistryAdapterFactory.class.getClassLoader().getResourceAsStream(path); + if (in == null) { + handleException("Registry Configuration File cannot be loaded from " + path, fnf); + + } + bufferedInputStream = new BufferedInputStream(in); + } + + } catch (IOException e) { + handleException("Registry Configuration File cannot be loaded from " + path, e); + + } + return bufferedInputStream; + } + private static void handleException(String msg, Exception e) { log.error(msg, e); throw new SynapseException(msg, e); Modified: branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/registry/WSO2RegistryAdapter.java URL: http://wso2.org/svn/browse/wso2/branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/registry/WSO2RegistryAdapter.java?rev=17736&r1=17735&r2=17736&view=diff ============================================================================== --- branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/registry/WSO2RegistryAdapter.java (original) +++ branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/registry/WSO2RegistryAdapter.java Sun Jun 1 09:03:02 2008 @@ -32,9 +32,10 @@ import org.apache.synapse.registry.RegistryEntry; import org.apache.synapse.registry.RegistryEntryImpl; import org.apache.synapse.util.SynapseBinaryDataSource; -import org.wso2.esb.ServiceBusConstants; import org.wso2.registry.*; +import org.wso2.registry.exceptions.RegistryException; import org.wso2.registry.utils.RegistryClientUtils; +import org.wso2.esb.ServiceBusConstants; import javax.activation.DataHandler; import javax.xml.stream.XMLInputFactory; @@ -261,7 +262,12 @@ if (resource instanceof Collection) { CollectionImpl collection = (CollectionImpl) resource; - String[] children = collection.getChildren(); + String[] children = new String[0]; + try { + children = collection.getChildren(); + } catch (RegistryException e) { + handleException("Error when retrieving children"); + } List<RegistryEntry> entryList = new ArrayList<RegistryEntry>(); for (String child : children) { @@ -303,7 +309,7 @@ ArrayList<RegistryEntry> list = new ArrayList<RegistryEntry>(); RegistryEntry[] entries = getChildren(entry); - + if (entries != null) { for (RegistryEntry entry1 : entries) { if (list.size() > MAX_KEYS) { @@ -387,7 +393,7 @@ try { cacheTime = Long.parseLong(cachableDuration); } catch (NumberFormatException e) { - handleException("Couldn't pass the cachableDuration as a long", e); + handleException("Couldn't pass the cachableDuration as a long", e); } } } @@ -530,12 +536,12 @@ if (!registry.resourceExists(path)) { RegistryClientUtils.importToRegistry(child, - toPath, registry); + toPath, registry); } } catch (RegistryException e) { handleException("Error when importing resources in " + - "the path : " + file.getPath(), e); + "the path : " + file.getPath(), e); } } } @@ -565,14 +571,14 @@ resource = registry.get(resolvedPath); } } catch (RegistryException e) { - handleException("Error when fetching resource wit key " + s, e); + handleException("Error when fetching resource with key " + s, e); } return resource; } private String removePathSeparator(String path) { - if (path.endsWith(RegistryConstants.PATH_SEPARATOR)) { + if (path != null && path.endsWith(RegistryConstants.PATH_SEPARATOR)) { return path.substring(0, path.lastIndexOf(RegistryConstants.PATH_SEPARATOR)); } else { return path; @@ -582,6 +588,9 @@ private String calculatePath(String parentPath, String resourceName) { String resourcePath; resourceName = removePathSeparator(resourceName); + if (parentPath == null) { + return resourceName; + } if (resourceName.startsWith(RegistryConstants.PATH_SEPARATOR)) { resourceName = resourceName.substring(1, resourceName.length()); } @@ -599,14 +608,21 @@ private String getParentPath(String resourcePath) { String parentPath; + if (resourcePath == null) { + handleException("Resource path cannot be null"); + } if (resourcePath.equals(RegistryConstants.ROOT_PATH)) { parentPath = null; } else { - if (resourcePath.lastIndexOf(RegistryConstants.PATH_SEPARATOR) == 0) { + if (resourcePath.indexOf(RegistryConstants.PATH_SEPARATOR) < 0) { parentPath = RegistryConstants.ROOT_PATH; } else { - parentPath = resourcePath.substring( - 0, resourcePath.lastIndexOf(RegistryConstants.PATH_SEPARATOR)); + if (resourcePath.lastIndexOf(RegistryConstants.PATH_SEPARATOR) == 0) { + parentPath = RegistryConstants.ROOT_PATH; + } else { + parentPath = resourcePath.substring( + 0, resourcePath.lastIndexOf(RegistryConstants.PATH_SEPARATOR)); + } } } return parentPath; @@ -618,6 +634,9 @@ } private String getResourcePath(String path) { + if (path == null) { + return ""; + } path = calculatePath(RegistryConstants.PATH_SEPARATOR, path); if (path.startsWith(rootPath)) { path = path.substring(rootPath.length(), path.length()); @@ -637,9 +656,13 @@ correctedPath = path.substring(0, path.lastIndexOf(RegistryConstants.PATH_SEPARATOR)); } - return correctedPath.substring( - correctedPath.lastIndexOf(RegistryConstants.PATH_SEPARATOR) + 1, - correctedPath.length()); + if (correctedPath.indexOf(RegistryConstants.PATH_SEPARATOR) > 0) { + return correctedPath.substring( + correctedPath.lastIndexOf(RegistryConstants.PATH_SEPARATOR) + 1, + correctedPath.length()); + } else { + return correctedPath; + } } return ""; Modified: branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/services/LogAdmin.java URL: http://wso2.org/svn/browse/wso2/branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/services/LogAdmin.java?rev=17736&r1=17735&r2=17736&view=diff ============================================================================== --- branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/services/LogAdmin.java (original) +++ branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/services/LogAdmin.java Sun Jun 1 09:03:02 2008 @@ -25,8 +25,8 @@ import org.apache.log4j.Logger; import org.apache.log4j.PropertyConfigurator; import org.wso2.esb.services.tos.LogConfigData; - import org.wso2.esb.ServiceBusConstants; import org.wso2.esb.ServiceBusConfiguration; + import org.wso2.esb.ServiceBusConstants; import java.io.*; import java.util.Enumeration; Modified: branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/services/RegistryAdmin.java URL: http://wso2.org/svn/browse/wso2/branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/services/RegistryAdmin.java?rev=17736&r1=17735&r2=17736&view=diff ============================================================================== --- branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/services/RegistryAdmin.java (original) +++ branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/services/RegistryAdmin.java Sun Jun 1 09:03:02 2008 @@ -26,27 +26,22 @@ import org.apache.synapse.SynapseException; import org.apache.synapse.Mediator; import org.apache.synapse.SynapseConstants; -import org.apache.synapse.endpoints.Endpoint; import org.apache.synapse.config.SynapseConfiguration; -import org.apache.synapse.config.xml.endpoints.EndpointFactory; -import org.apache.synapse.config.xml.SequenceMediatorFactory; import org.apache.synapse.config.xml.MediatorFactoryFinder; import org.apache.synapse.config.xml.MediatorSerializerFinder; import org.apache.synapse.registry.Registry; import org.apache.synapse.registry.RegistryEntry; import org.apache.synapse.registry.RegistryEntryImpl; import org.apache.synapse.registry.url.SimpleURLRegistry; -import org.wso2.esb.ServiceBusConstants; import org.wso2.esb.registry.WSO2Registry; import org.wso2.esb.registry.ESBRegistry; +import org.wso2.esb.ServiceBusConstants; import javax.xml.namespace.QName; import java.util.ArrayList; import java.util.Iterator; import java.io.File; -import com.ctc.wstx.dtd.SeqContentSpec; - public class RegistryAdmin extends AbstractESBAdmin { private static final Log log = LogFactory.getLog(RegistryAdmin.class); @@ -78,7 +73,7 @@ try { RegistryEntry[] entries = reg.getDescendants(null); - for(int i=0; i<entries.length; i++) { + for (int i = 0; i < entries.length; i++) { keyList.add(entries[i].getKey()); } } catch (SynapseException e) { @@ -86,8 +81,8 @@ } String[] keys = new String[keyList.size()]; - for(int i=0; i<keyList.size(); i++) { - keys[i] = (String)keyList.get(i); + for (int i = 0; i < keyList.size(); i++) { + keys[i] = (String) keyList.get(i); } return keys; @@ -97,13 +92,10 @@ * Returns the children of the given registry entry. * * @param key - * - * @return - * <children> - * <regEntry><key>key</key><type>file/folder</type></regEntry> - * ... - * </children> - * + * @return <children> + * <regEntry><key>key</key><type>file/folder</type></regEntry> + * ... + * </children> * @throws AxisFault */ public OMElement getChildren(String key) throws AxisFault { @@ -123,7 +115,7 @@ entryEmbedded.setKey(key); RegistryEntry[] entries = reg.getChildren(entryEmbedded); if (entries != null) { - for(int i=0; i<entries.length; i++) { + for (int i = 0; i < entries.length; i++) { OMElement entryElement = fac.createOMElement("regEntry", null); OMElement keyElement = fac.createOMElement("key", null); @@ -142,7 +134,7 @@ } } else { handleFault(log, "Selected entry is a leaf level entry. " + - "No child entries are available for leaf entries", null); + "No child entries are available for leaf entries", null); } } catch (SynapseException e) { handleFault(log, "Couldn't get child elements from registry", e); @@ -239,14 +231,11 @@ /** * Creates new folder in the given parent folder. * - * @param entryElement - * <folder><folderName>new folder name</folderName><parent>parent folder name</parent></folder> - * + * @param entryElement <folder><folderName>new folder name</folderName><parent>parent folder name</parent></folder> * @return OMElement - * <folder> - * <folderPath>full new folder name<folderPath><status>successfull/failed</status> - * </folder> - * + * <folder> + * <folderPath>full new folder name<folderPath><status>successfull/failed</status> + * </folder> * @throws AxisFault */ public OMElement createFolder(OMElement entryElement) throws AxisFault { @@ -255,7 +244,7 @@ if (reg != null) { - String newFolderName = null; + String newFolderName = null; String parentName = null; OMElement entryNameElement @@ -273,14 +262,14 @@ log.debug("Creating folder : " + newFolderName + " under : " + parentName); try { - reg.newResource(parentName + File.separator + newFolderName, true); + reg.newResource(parentName + "/" + newFolderName, true); //esbRegistry.createFolder(parentName, newFolderName); OMFactory fac = OMAbstractFactory.getOMFactory(); OMElement rFolder = fac.createOMElement("folder", null); OMElement path = fac.createOMElement("folderPath", null); - path.setText(parentName + File.separator + newFolderName); + path.setText(parentName + "/" + newFolderName); rFolder.addChild(path); OMElement status = fac.createOMElement("status", null); @@ -303,14 +292,12 @@ /** * Adds a new file to the registry. * - * @param fileElement - * <file> - * <fileName>file name</fileName><parent>parent key</parent><content>xml content</content> - * </file> - * if <content> element is absent, creates an empty file. - * + * @param fileElement <file> + * <fileName>file name</fileName><parent>parent key</parent><content>xml content</content> + * </file> + * if <content> element is absent, creates an empty file. * @return OMElement - * <file><filePath>full file path</filePath><status>ok/failed</status></file> + * <file><filePath>full file path</filePath><status>ok/failed</status></file> */ public OMElement createFile(OMElement fileElement) throws AxisFault { Registry reg = getDefaultRegistry(); @@ -348,21 +335,21 @@ parentName = parentNameElement.getText(); } else { handleFault(log, "Unable to create resource. Resource name, content and parent" + - " directory must be specified", null); + " directory must be specified", null); } try { - reg.newResource(parentName +File.separator+newFileName, false); + reg.newResource(parentName + "/" + newFileName, false); reg.updateResource - (parentName +File.separator + newFileName, contentElement); + (parentName + "/" + newFileName, contentElement); //esbRegistry.createFile(parentName, newFileName, content); OMFactory fac = OMAbstractFactory.getOMFactory(); OMElement rFile = fac.createOMElement("file", null); OMElement filePath = fac.createOMElement("filePath", null); - filePath.setText(parentName + File.separator + newFileName); + filePath.setText(parentName + "/" + newFileName); rFile.addChild(filePath); OMElement status = fac.createOMElement("status", null); @@ -374,7 +361,7 @@ } catch (Exception e) { handleFault(log, - "Couldn't create new file: " + newFileName + " under : " + parentName, e); + "Couldn't create new file: " + newFileName + " under : " + parentName, e); } } else { @@ -431,7 +418,7 @@ OMElement valueElement = fac.createOMElement("value", null); valueElement.addChild(resourceNode); entryElement.addChild(valueElement); - } catch(Exception e) { + } catch (Exception e) { // add an error message to the body OMElement errElement = fac.createOMElement("error", null); errElement.setText("Couldn't read from the registry entry."); @@ -444,8 +431,7 @@ /** * Updates the registry entry file. * - * @param regEntryElement - * <regEntry><key>registry key</key><value>xml contents of the file</value></regEntry> + * @param regEntryElement <regEntry><key>registry key</key><value>xml contents of the file</value></regEntry> */ public void updateRegistryEntryValue(OMElement regEntryElement) throws AxisFault { Modified: branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/services/ServiceAdmin.java URL: http://wso2.org/svn/browse/wso2/branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/services/ServiceAdmin.java?rev=17736&r1=17735&r2=17736&view=diff ============================================================================== --- branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/services/ServiceAdmin.java (original) +++ branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/services/ServiceAdmin.java Sun Jun 1 09:03:02 2008 @@ -21,8 +21,8 @@ import org.apache.log4j.Logger; import org.apache.synapse.SynapseConstants; -import org.wso2.esb.ServiceBusConstants; import org.wso2.esb.ServiceBusException; +import org.wso2.esb.ServiceBusConstants; import org.wso2.esb.persistence.PersistenceManager; import org.wso2.esb.persistence.dataobject.StatisticsDO; import org.wso2.esb.services.tos.GraphData; Modified: branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/statistics/StatisticsReporterThread.java URL: http://wso2.org/svn/browse/wso2/branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/statistics/StatisticsReporterThread.java?rev=17736&r1=17735&r2=17736&view=diff ============================================================================== --- branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/statistics/StatisticsReporterThread.java (original) +++ branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/statistics/StatisticsReporterThread.java Sun Jun 1 09:03:02 2008 @@ -23,10 +23,10 @@ import org.apache.synapse.core.SynapseEnvironment; import org.apache.synapse.statistics.StatisticsCollector; import org.apache.synapse.statistics.StatisticsHolder; -import org.wso2.esb.ServiceBusConstants; import org.wso2.esb.persistence.PersistenceManager; import org.wso2.esb.statistics.persistence.StatisticsDBUtils; import org.wso2.esb.util.HibernateConfigCache; +import org.wso2.esb.ServiceBusConstants; import java.net.InetAddress; import java.net.UnknownHostException; Modified: branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/statistics/persistence/StatisticsDBUtils.java URL: http://wso2.org/svn/browse/wso2/branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/statistics/persistence/StatisticsDBUtils.java?rev=17736&r1=17735&r2=17736&view=diff ============================================================================== --- branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/statistics/persistence/StatisticsDBUtils.java (original) +++ branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/statistics/persistence/StatisticsDBUtils.java Sun Jun 1 09:03:02 2008 @@ -21,9 +21,9 @@ import org.apache.synapse.statistics.Statistics; import org.apache.synapse.statistics.StatisticsHolder; -import org.wso2.esb.ServiceBusConstants; import org.wso2.esb.persistence.PersistenceManager; import org.wso2.esb.persistence.dataobject.StatisticsDO; +import org.wso2.esb.ServiceBusConstants; import java.util.List; Modified: branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/ESBServlet.java URL: http://wso2.org/svn/browse/wso2/branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/ESBServlet.java?rev=17736&r1=17735&r2=17736&view=diff ============================================================================== --- branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/ESBServlet.java (original) +++ branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/ESBServlet.java Sun Jun 1 09:03:02 2008 @@ -27,8 +27,8 @@ import org.apache.axis2.transport.http.ListingAgent; import org.jaxen.SimpleNamespaceContext; import org.jaxen.XPath; -import org.wso2.esb.ServiceBusConstants; import org.wso2.esb.ServiceBusManager; +import org.wso2.esb.ServiceBusConstants; import org.wso2.esb.transport.HttpGetRequestProcessor; import org.wso2.utils.ServerConfiguration; @@ -56,11 +56,11 @@ private static final QName CLASS_QN = new QName("http://www.wso2.org/projects/esb", "Class"); public void init(ServletConfig config) throws ServletException { - ServletContext servletContext = config.getServletContext(); + servletConfig = config; + ServletContext servletContext = servletConfig.getServletContext(); configContext = ServiceBusManager.getInstance().getConfigurationContext(); axisConfiguration = configContext.getAxisConfiguration(); servletContext.setAttribute(this.getClass().getName(), this); - servletConfig = config; agent = new ListingAgent(configContext); populateGetRequestProcessors(); initParams(); Modified: branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/HttpsTransportListener.java URL: http://wso2.org/svn/browse/wso2/branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/HttpsTransportListener.java?rev=17736&r1=17735&r2=17736&view=diff ============================================================================== --- branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/HttpsTransportListener.java (original) +++ branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/HttpsTransportListener.java Sun Jun 1 09:03:02 2008 @@ -26,8 +26,8 @@ import org.apache.axis2.description.TransportInDescription; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.esb.ServiceBusConstants; import org.wso2.esb.ServiceBusConfiguration; +import org.wso2.esb.ServiceBusConstants; import org.wso2.utils.transport.AbstractTransportListener; /** Modified: branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/StartUpServlet.java URL: http://wso2.org/svn/browse/wso2/branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/StartUpServlet.java?rev=17736&r1=17735&r2=17736&view=diff ============================================================================== --- branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/StartUpServlet.java (original) +++ branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/StartUpServlet.java Sun Jun 1 09:03:02 2008 @@ -23,9 +23,9 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.adminui.AdminUIServletFilter; -import org.wso2.esb.ServiceBusConstants; import org.wso2.esb.ServiceBusManager; import org.wso2.esb.ServiceBusConfiguration; +import org.wso2.esb.ServiceBusConstants; import javax.servlet.ServletConfig; import javax.servlet.ServletContext; Modified: branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/util/XmlConfiguration.java URL: http://wso2.org/svn/browse/wso2/branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/util/XmlConfiguration.java?rev=17736&r1=17735&r2=17736&view=diff ============================================================================== --- branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/util/XmlConfiguration.java (original) +++ branches/esb/java/1.7/esb/java/modules/core/src/main/java/org/wso2/esb/util/XmlConfiguration.java Sun Jun 1 09:03:02 2008 @@ -27,8 +27,8 @@ import org.jaxen.JaxenException; import org.jaxen.SimpleNamespaceContext; import org.jaxen.XPath; -import org.wso2.esb.ServiceBusConstants; import org.wso2.utils.ServerException; +import org.wso2.esb.ServiceBusConstants; import javax.xml.stream.XMLStreamException; import java.io.FileNotFoundException; Modified: branches/esb/java/1.7/esb/java/modules/distribution/src/main/assembly/bin.xml URL: http://wso2.org/svn/browse/wso2/branches/esb/java/1.7/esb/java/modules/distribution/src/main/assembly/bin.xml?rev=17736&r1=17735&r2=17736&view=diff ============================================================================== --- branches/esb/java/1.7/esb/java/modules/distribution/src/main/assembly/bin.xml (original) +++ branches/esb/java/1.7/esb/java/modules/distribution/src/main/assembly/bin.xml Sun Jun 1 09:03:02 2008 @@ -91,17 +91,17 @@ <exclude>web.xml</exclude> <exclude>tomcat</exclude> <exclude>tomcat/*</exclude> - <exclude>synapse.properties</exclude> + <!--<exclude>synapse.properties</exclude>--> </excludes> </fileSet> - <fileSet> - <directory>src/main/conf</directory> - <outputDirectory>wso2esb-${wso2.esb.version}/webapp/WEB-INF/classes - </outputDirectory> - <includes> - <include>synapse.properties</include> - </includes> - </fileSet> + <!--<fileSet>--> + <!--<directory>src/main/conf</directory>--> + <!--<outputDirectory>wso2esb-${wso2.esb.version}/webapp/WEB-INF/classes--> + <!--</outputDirectory>--> + <!--<includes>--> + <!--<include>synapse.properties</include>--> + <!--</includes>--> + <!--</fileSet>--> <fileSet> <directory>target/temp/docs</directory> <outputDirectory>wso2esb-${wso2.esb.version}/docs</outputDirectory> Added: branches/esb/java/1.7/esb/java/modules/distribution/src/main/conf/registry.xml URL: http://wso2.org/svn/browse/wso2/branches/esb/java/1.7/esb/java/modules/distribution/src/main/conf/registry.xml?pathrev=17736 ============================================================================== --- (empty file) +++ branches/esb/java/1.7/esb/java/modules/distribution/src/main/conf/registry.xml Sun Jun 1 09:03:02 2008 @@ -0,0 +1,21 @@ +<wso2regsitry> + <currentConfig>derby-db</currentConfig> + + <!--<dbconfig name="in-memory">--> + <!--<url>jdbc:hsqldb:mem:aname</url>--> + <!--<userName>sa</userName>--> + <!--<password/>--> + <!--<driverName>org.hsqldb.jdbcDriver</driverName>--> + <!--</dbconfig>--> + + <dbconfig name="derby-db"> + <driverName>org.apache.derby.jdbc.ClientDriver</driverName> + <url>jdbc:derby://localhost:1528/database/WSO2REGISTRY_DB;create=true</url> + <userName>wso2esb</userName> + <password>wso2esb</password> + </dbconfig> + + <!--<dbconfig name="registry-datasource">--> + <!--<dataSource>dataSourceName</dataSource>--> + <!--</dbconfig>--> +</wso2regsitry> Modified: branches/esb/java/1.7/esb/java/modules/distribution/src/main/conf/server.xml URL: http://wso2.org/svn/browse/wso2/branches/esb/java/1.7/esb/java/modules/distribution/src/main/conf/server.xml?rev=17736&r1=17735&r2=17736&view=diff ============================================================================== --- branches/esb/java/1.7/esb/java/modules/distribution/src/main/conf/server.xml (original) +++ branches/esb/java/1.7/esb/java/modules/distribution/src/main/conf/server.xml Sun Jun 1 09:03:02 2008 @@ -40,10 +40,11 @@ <importRoot>file:registry</importRoot> <type>local</type> <configuration> - <driverClass>org.apache.derby.jdbc.ClientDriver</driverClass> - <url>jdbc:derby://localhost:1528/database/WSO2REGISTRY_DB;create=true</url> - <username>wso2esb</username> - <password>wso2esb</password> + <Location>webapp/WEB-INF/classes/conf/registry.xml</Location> + <!--<driverClass>org.apache.derby.jdbc.ClientDriver</driverClass>--> + <!--<url>jdbc:derby://localhost:1528/database/WSO2REGISTRY_DB;create=true</url>--> + <!--<username>wso2esb</username>--> + <!--<password>wso2esb</password>--> </configuration> </Registry> Added: branches/esb/java/1.7/esb/java/modules/distribution/src/main/www/global_params.js URL: http://wso2.org/svn/browse/wso2/branches/esb/java/1.7/esb/java/modules/distribution/src/main/www/global_params.js?pathrev=17736 ============================================================================== --- (empty file) +++ branches/esb/java/1.7/esb/java/modules/distribution/src/main/www/global_params.js Sun Jun 1 09:03:02 2008 @@ -0,0 +1,3 @@ +/*This is just an empty js which has put their to support all the containers. +The content of the js has been pumped by org.wso2.adminui.AdminUIServletFilter filter. +*/ \ No newline at end of file Deleted: branches/esb/java/1.7/esb/java/modules/startup/src/main/java/org/wso2/esb/ServiceBusConstants.java URL: http://wso2.org/svn/browse/wso2/None?pathrev=17735 Modified: branches/esb/java/1.7/esb/java/modules/startup/src/main/java/org/wso2/esb/TomcatServer.java URL: http://wso2.org/svn/browse/wso2/branches/esb/java/1.7/esb/java/modules/startup/src/main/java/org/wso2/esb/TomcatServer.java?rev=17736&r1=17735&r2=17736&view=diff ============================================================================== --- branches/esb/java/1.7/esb/java/modules/startup/src/main/java/org/wso2/esb/TomcatServer.java (original) +++ branches/esb/java/1.7/esb/java/modules/startup/src/main/java/org/wso2/esb/TomcatServer.java Sun Jun 1 09:03:02 2008 @@ -45,7 +45,7 @@ private static Log log = LogFactory.getLog(TomcatServer.class); private Embedded embedded; private Properties props = null; - + public static final String HTTPS_TRANSPORT = "https"; public TomcatServer() { props = new Properties(); try { @@ -135,7 +135,7 @@ // SSLConnector Connector sslConnector = embedded.createConnector( (InetAddress) null, Integer.parseInt(getTomcatProperty("ConsolePort", "9444")), true); - sslConnector.setScheme(ServiceBusConstants.HTTPS_TRANSPORT); + sslConnector.setScheme(HTTPS_TRANSPORT); if (ksPassword != null) { IntrospectionUtils.setProperty(sslConnector, "keypass", ksPassword); Modified: branches/esb/java/1.7/esb/java/pom.xml URL: http://wso2.org/svn/browse/wso2/branches/esb/java/1.7/esb/java/pom.xml?rev=17736&r1=17735&r2=17736&view=diff ============================================================================== --- branches/esb/java/1.7/esb/java/pom.xml (original) +++ branches/esb/java/1.7/esb/java/pom.xml Sun Jun 1 09:03:02 2008 @@ -837,7 +837,7 @@ <wso2commons.utils.version>2.2.1</wso2commons.utils.version> <wso2.adminui.version>1.2</wso2.adminui.version> <wso2.adminui.version.graphs>1.1</wso2.adminui.version.graphs> - <wso2registry.core.version>1.1-RC1</wso2registry.core.version> + <wso2registry.core.version>1.1</wso2registry.core.version> <hsqldb.version>1.8.0</hsqldb.version> <authenticator.version>0.5</authenticator.version> _______________________________________________ Esb-java-dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev
