geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgenen...@apache.org
Subject svn commit: r481300 - in /geronimo/sandbox/gcache: client/src/main/java/org/apache/geronimo/gcache/client/dd/ client/src/main/xsd/ common/ common/src/main/java/org/apache/geronimo/gcache/dd/ server/ server/src/main/java/org/apache/geronimo/gcache/dd/ s...
Date Fri, 01 Dec 2006 17:06:53 GMT
Author: jgenender
Date: Fri Dec  1 09:06:51 2006
New Revision: 481300

URL: http://svn.apache.org/viewvc?view=rev&rev=481300
Log:
Refactoring

Added:
    geronimo/sandbox/gcache/client/src/main/java/org/apache/geronimo/gcache/client/dd/
    geronimo/sandbox/gcache/client/src/main/java/org/apache/geronimo/gcache/client/dd/JaxbGcacheClientConfigurationFactory.java
    geronimo/sandbox/gcache/common/src/main/java/org/apache/geronimo/gcache/dd/
    geronimo/sandbox/gcache/common/src/main/java/org/apache/geronimo/gcache/dd/GcacheConfiguration.java
    geronimo/sandbox/gcache/common/src/main/java/org/apache/geronimo/gcache/dd/JaxbConfigFactory.java
    geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/dd/GcacheServerConfiguration.java
    geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/dd/JaxbGcacheServerConfigurationFactory.java
    geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/dd/ServerConfigBuilder.java
  (contents, props changed)
      - copied, changed from r479767, geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/dd/ConfigBuilder.java
    geronimo/sandbox/gcache/server/src/main/xsd/catalog.cat
    geronimo/sandbox/gcache/server/src/main/xsd/gcache-server.xsd   (contents, props changed)
      - copied, changed from r477589, geronimo/sandbox/gcache/server/src/main/xsd/gcache.xsd
Removed:
    geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/dd/ConfigBuilder.java
    geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/dd/GcacheConfiguration.java
    geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/dd/JaxbGcacheConfigFactory.java
    geronimo/sandbox/gcache/server/src/main/xjb/
    geronimo/sandbox/gcache/server/src/main/xsd/gcache.xsd
Modified:
    geronimo/sandbox/gcache/client/src/main/xsd/gcache-client.xsd
    geronimo/sandbox/gcache/common/pom.xml
    geronimo/sandbox/gcache/server/pom.xml
    geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/server/GCacheManager.java
    geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/transports/tcp/TCPCommandVisitor.java
    geronimo/sandbox/gcache/server/src/main/resources/gcache-server-config-default.xml
    geronimo/sandbox/gcache/server/src/test/java/org/apache/geronimo/gcache/dd/ConfigBuilderTest.java
    geronimo/sandbox/gcache/server/src/test/resources/gcache-server-config.xml

Added: geronimo/sandbox/gcache/client/src/main/java/org/apache/geronimo/gcache/client/dd/JaxbGcacheClientConfigurationFactory.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gcache/client/src/main/java/org/apache/geronimo/gcache/client/dd/JaxbGcacheClientConfigurationFactory.java?view=auto&rev=481300
==============================================================================
--- geronimo/sandbox/gcache/client/src/main/java/org/apache/geronimo/gcache/client/dd/JaxbGcacheClientConfigurationFactory.java
(added)
+++ geronimo/sandbox/gcache/client/src/main/java/org/apache/geronimo/gcache/client/dd/JaxbGcacheClientConfigurationFactory.java
Fri Dec  1 09:06:51 2006
@@ -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.gcache.client.dd;
+
+import java.net.URL;
+
+import org.apache.geronimo.gcache.dd.JaxbConfigFactory;
+
+public class JaxbGcacheClientConfigurationFactory extends JaxbConfigFactory {
+
+    public static final String SCHEMA = "http://geronimo.apache.org/xml/ns/gcache-client-1.0";
+    
+    protected GcacheClientConfig getConfig(URL url) throws Exception {
+        return getConfig(url, GcacheClientConfig.class);
+    }
+
+    @Override
+    public String getSchema() {
+        return SCHEMA;
+    }
+}

Modified: geronimo/sandbox/gcache/client/src/main/xsd/gcache-client.xsd
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gcache/client/src/main/xsd/gcache-client.xsd?view=diff&rev=481300&r1=481299&r2=481300
==============================================================================
--- geronimo/sandbox/gcache/client/src/main/xsd/gcache-client.xsd (original)
+++ geronimo/sandbox/gcache/client/src/main/xsd/gcache-client.xsd Fri Dec  1 09:06:51 2006
@@ -9,9 +9,9 @@
 	<xs:import namespace="http://geronimo.apache.org/xml/ns/gcache-1.0" schemaLocation="http://geronimo.apache.org/xml/ns/gcache-1.0.xsd"/>
 
 	<xs:element name="gcache-client-config"
-		type="gcache-client:gcacheClientConfigType" />
+		type="gcache-client:gcacheClientConfig" />
 
-	<xs:complexType name="gcacheClientConfigType">
+	<xs:complexType name="gcacheClientConfig">
 		<xs:sequence>
 			<xs:element name="transport" type="gcache:transportType"
 				minOccurs="1" maxOccurs="1" />

Modified: geronimo/sandbox/gcache/common/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gcache/common/pom.xml?view=diff&rev=481300&r1=481299&r2=481300
==============================================================================
--- geronimo/sandbox/gcache/common/pom.xml (original)
+++ geronimo/sandbox/gcache/common/pom.xml Fri Dec  1 09:06:51 2006
@@ -22,9 +22,19 @@
         </dependency>
         
         <dependency>
+            <groupId>com.sun.xml.bind</groupId>
+            <artifactId>jaxb-impl</artifactId>
+        </dependency>
+        
+        <dependency>
             <groupId>commons-logging</groupId>
             <artifactId>commons-logging</artifactId>
         </dependency>
+        
+       <dependency>
+			<groupId>javax.xml.bind</groupId>
+			<artifactId>jaxb-api</artifactId>
+		</dependency>
         
         <dependency>
             <groupId>log4j</groupId>

Added: geronimo/sandbox/gcache/common/src/main/java/org/apache/geronimo/gcache/dd/GcacheConfiguration.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gcache/common/src/main/java/org/apache/geronimo/gcache/dd/GcacheConfiguration.java?view=auto&rev=481300
==============================================================================
--- geronimo/sandbox/gcache/common/src/main/java/org/apache/geronimo/gcache/dd/GcacheConfiguration.java
(added)
+++ geronimo/sandbox/gcache/common/src/main/java/org/apache/geronimo/gcache/dd/GcacheConfiguration.java
Fri Dec  1 09:06:51 2006
@@ -0,0 +1,54 @@
+/**
+ *
+ * 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.gcache.dd;
+
+import java.net.URI;
+
+import net.sf.ehcache.config.Configuration;
+
+public class GcacheConfiguration {
+    private Configuration ehcacheConfig = null;
+    private String transportName;
+    private URI transportUri;
+    private URI discoveryUri;
+    
+    public Configuration getEhcacheConfig() {
+        return ehcacheConfig;
+    }
+    public void setEhcacheConfig(Configuration ehcacheConfig) {
+        this.ehcacheConfig = ehcacheConfig;
+    }
+    public String getTransportName() {
+        return transportName;
+    }
+    public void setTransportName(String transportName) {
+        this.transportName = transportName;
+    }
+    public URI getDiscoveryUri() {
+        return discoveryUri;
+    }
+    public void setDiscoveryUri(URI discoveryUri) {
+        this.discoveryUri = discoveryUri;
+    }
+    public URI getTransportUri() {
+        return transportUri;
+    }
+    public void setTransportUri(URI transportUri) {
+        this.transportUri = transportUri;
+    }
+}

Added: geronimo/sandbox/gcache/common/src/main/java/org/apache/geronimo/gcache/dd/JaxbConfigFactory.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gcache/common/src/main/java/org/apache/geronimo/gcache/dd/JaxbConfigFactory.java?view=auto&rev=481300
==============================================================================
--- geronimo/sandbox/gcache/common/src/main/java/org/apache/geronimo/gcache/dd/JaxbConfigFactory.java
(added)
+++ geronimo/sandbox/gcache/common/src/main/java/org/apache/geronimo/gcache/dd/JaxbConfigFactory.java
Fri Dec  1 09:06:51 2006
@@ -0,0 +1,102 @@
+/**
+ *
+ * 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.gcache.dd;
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StringReader;
+import java.net.URL;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.UnmarshallerHandler;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.sax.SAXSource;
+
+import org.apache.geronimo.gcache.util.StringUtil;
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLFilterImpl;
+
+public abstract class JaxbConfigFactory {
+
+    public abstract String getSchema();
+
+    protected <T> T getConfig(URL url, Class T) throws Exception {
+        InputStream gcacheDescriptor = null;
+
+        try {
+
+            gcacheDescriptor = url.openStream();
+
+            //First read the file into memory to convert properties before processing
+            BufferedReader in = new BufferedReader(new InputStreamReader(gcacheDescriptor));
+            String inputLine;
+
+            StringBuffer inFile = new StringBuffer();
+            while ((inputLine = in.readLine()) != null)
+                inFile.append(inputLine);
+            in.close();
+            StringUtil.parseAndReplaceSystemProperty(inFile);
+
+            JAXBContext jc = JAXBContext.newInstance(T);
+            Unmarshaller u = jc.createUnmarshaller();
+            UnmarshallerHandler uh = u.getUnmarshallerHandler();
+
+            // create a new XML parser
+            SAXParserFactory factory = SAXParserFactory.newInstance();
+            factory.setNamespaceAware(true);
+            factory.setValidating(true);
+            SAXParser parser = factory.newSAXParser();
+
+            XMLReader xmlReader = parser.getXMLReader();
+
+            // Create a filter to intercept events
+            NamespaceFilter xmlFilter = new NamespaceFilter(xmlReader);
+
+            // Be sure the filter has the JAXB content handler set (or it wont
+            // work)
+            xmlFilter.setContentHandler(uh);
+            SAXSource source = new SAXSource(xmlFilter, new InputSource(new StringReader(inFile.toString())
));
+
+            return (T) u.unmarshal(source);
+
+        } finally {
+            if (gcacheDescriptor != null)
+                gcacheDescriptor.close();
+        }
+    }
+
+    // Inject the proper namespace
+    public class NamespaceFilter extends XMLFilterImpl {
+
+        public NamespaceFilter(XMLReader arg0) {
+            super(arg0);
+        }
+
+        @Override
+        public void startElement(String arg0, String arg1, String arg2,
+                                 Attributes arg3) throws SAXException {
+            super.startElement(getSchema(), arg1, arg2, arg3);
+        }
+    }
+}

Modified: geronimo/sandbox/gcache/server/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gcache/server/pom.xml?view=diff&rev=481300&r1=481299&r2=481300
==============================================================================
--- geronimo/sandbox/gcache/server/pom.xml (original)
+++ geronimo/sandbox/gcache/server/pom.xml Fri Dec  1 09:06:51 2006
@@ -90,7 +90,8 @@
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>jaxb2-maven-plugin</artifactId>
                 <configuration>
-                    <packageName>org.apache.geronimo.gcache.dd</packageName>
+                	<catalog>${basedir}/src/main/xsd/catalog.cat</catalog>
+                    <packageName>org.apache.geronimo.gcache.server.dd</packageName>
                     <extension>true</extension>
                 </configuration>
             </plugin>

Added: geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/dd/GcacheServerConfiguration.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/dd/GcacheServerConfiguration.java?view=auto&rev=481300
==============================================================================
--- geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/dd/GcacheServerConfiguration.java
(added)
+++ geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/dd/GcacheServerConfiguration.java
Fri Dec  1 09:06:51 2006
@@ -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.gcache.dd;
+
+public class GcacheServerConfiguration extends GcacheConfiguration{
+    private int order;
+    private String serverName;
+    
+    public int getOrder() {
+        return order;
+    }
+    public void setOrder(int order) {
+        this.order = order;
+    }
+    public String getServerName() {
+        return serverName;
+    }
+    public void setServerName(String serverName) {
+        this.serverName = serverName;
+    }
+}

Added: geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/dd/JaxbGcacheServerConfigurationFactory.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/dd/JaxbGcacheServerConfigurationFactory.java?view=auto&rev=481300
==============================================================================
--- geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/dd/JaxbGcacheServerConfigurationFactory.java
(added)
+++ geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/dd/JaxbGcacheServerConfigurationFactory.java
Fri Dec  1 09:06:51 2006
@@ -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.gcache.dd;
+
+import java.net.URL;
+
+import org.apache.geronimo.gcache.server.dd.GcacheServerConfig;
+
+public class JaxbGcacheServerConfigurationFactory extends JaxbConfigFactory {
+    
+    public static final String SCHEMA = "http://geronimo.apache.org/xml/ns/gcache-server-1.0";
+    
+    protected GcacheServerConfig getConfig(URL url) throws Exception {
+        return getConfig(url, GcacheServerConfig.class);
+    }
+
+    @Override
+    public String getSchema() {
+        return SCHEMA;
+    }
+
+}

Copied: geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/dd/ServerConfigBuilder.java
(from r479767, geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/dd/ConfigBuilder.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/dd/ServerConfigBuilder.java?view=diff&rev=481300&p1=geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/dd/ConfigBuilder.java&r1=479767&p2=geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/dd/ServerConfigBuilder.java&r2=481300
==============================================================================
--- geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/dd/ConfigBuilder.java
(original)
+++ geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/dd/ServerConfigBuilder.java
Fri Dec  1 09:06:51 2006
@@ -27,16 +27,22 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.gcache.server.dd.CacheType;
+import org.apache.geronimo.gcache.server.dd.DefaultCacheType;
+import org.apache.geronimo.gcache.server.dd.DiskStoreType;
+import org.apache.geronimo.gcache.server.dd.GcacheServerConfig;
+import org.apache.geronimo.gcache.server.dd.ServerType;
+import org.apache.geronimo.gcache.server.dd.TransportType;
 
-public class ConfigBuilder {
-    private static final Log log = LogFactory.getLog(ConfigBuilder.class);
+public class ServerConfigBuilder {
+    private static final Log log = LogFactory.getLog(ServerConfigBuilder.class);
 
     private static final String CLASSPATH_CONFIGURATION_FILE = "gcache-server-config.xml";
     private static final String DEFAULT_CLASSPATH_CONFIGURATION_FILE = "gcache-server-config-default.xml";
 
-    public GcacheConfiguration getConfig(URL fileURL){
+    public GcacheServerConfiguration getConfig(URL fileURL){
         
-        GcacheConfiguration config = null;
+        GcacheServerConfiguration config = null;
         ClassLoader cl = Thread.currentThread().getContextClassLoader(); 
         
         //Was a file passed to us?
@@ -64,14 +70,16 @@
         return config;
     }
 
-    private GcacheConfiguration processConfig(URL url){
+    private GcacheServerConfiguration processConfig(URL url){
         try {
-            GcacheConfiguration gcacheConfig = new GcacheConfiguration();
+            GcacheServerConfiguration gcacheConfig = new GcacheServerConfiguration();
             Configuration ehcacheConfig = new Configuration();
             DiskStoreConfiguration diskConfig = null;
             CacheConfiguration defaultCache = null;
+            
+            JaxbGcacheServerConfigurationFactory factory = new JaxbGcacheServerConfigurationFactory();
 
-            GcacheConfig config = JaxbGcacheConfigFactory.getConfig(url);
+            GcacheServerConfig config = factory.getConfig(url);
             
             // Get the server info
             ServerType server = config.getServer();

Propchange: geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/dd/ServerConfigBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/dd/ServerConfigBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/dd/ServerConfigBuilder.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/server/GCacheManager.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/server/GCacheManager.java?view=diff&rev=481300&r1=481299&r2=481300
==============================================================================
--- geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/server/GCacheManager.java
(original)
+++ geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/server/GCacheManager.java
Fri Dec  1 09:06:51 2006
@@ -28,8 +28,8 @@
 import org.apache.commons.cli.OptionBuilder;
 import org.apache.commons.cli.Options;
 import org.apache.geronimo.gcache.CacheInfoHolder;
-import org.apache.geronimo.gcache.dd.ConfigBuilder;
-import org.apache.geronimo.gcache.dd.GcacheConfiguration;
+import org.apache.geronimo.gcache.dd.GcacheServerConfiguration;
+import org.apache.geronimo.gcache.dd.ServerConfigBuilder;
 import org.apache.geronimo.gcache.transports.ServerConnectionManager;
 import org.apache.geronimo.gcache.transports.tcp.TCPCacheNotifier;
 import org.apache.geronimo.gcache.transports.tcp.TCPCommandVisitor;
@@ -47,9 +47,9 @@
     }
 
     public void start() throws Exception {
-        ConfigBuilder builder = new ConfigBuilder();
+        ServerConfigBuilder builder = new ServerConfigBuilder();
 
-        GcacheConfiguration config = builder.getConfig(configFile == null ? null : (new File(configFile)).toURL());
+        GcacheServerConfiguration config = builder.getConfig(configFile == null ? null :
(new File(configFile)).toURL());
 
         //Create a cache with the configuration from the gcache-config file
         cacheMgr = new CacheManager(config.getEhcacheConfig());

Modified: geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/transports/tcp/TCPCommandVisitor.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/transports/tcp/TCPCommandVisitor.java?view=diff&rev=481300&r1=481299&r2=481300
==============================================================================
--- geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/transports/tcp/TCPCommandVisitor.java
(original)
+++ geronimo/sandbox/gcache/server/src/main/java/org/apache/geronimo/gcache/transports/tcp/TCPCommandVisitor.java
Fri Dec  1 09:06:51 2006
@@ -18,7 +18,6 @@
  */
 package org.apache.geronimo.gcache.transports.tcp;
 
-import java.io.IOException;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;

Modified: geronimo/sandbox/gcache/server/src/main/resources/gcache-server-config-default.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gcache/server/src/main/resources/gcache-server-config-default.xml?view=diff&rev=481300&r1=481299&r2=481300
==============================================================================
--- geronimo/sandbox/gcache/server/src/main/resources/gcache-server-config-default.xml (original)
+++ geronimo/sandbox/gcache/server/src/main/resources/gcache-server-config-default.xml Fri
Dec  1 09:06:51 2006
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<gcache-config>
+<gcache-server-config>
 	<server order="1" serverName="gcache">
 		<transport name="default" uri="tcp://default" discoveryUri="multicast://default" />
 	</server>
@@ -8,4 +8,4 @@
 		timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="true"
 		diskPersistent="false" diskExpiryThreadIntervalSeconds="120"
 		memoryStoreEvictionPolicy="LRU" />
-</gcache-config>
+</gcache-server-config>

Added: geronimo/sandbox/gcache/server/src/main/xsd/catalog.cat
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gcache/server/src/main/xsd/catalog.cat?view=auto&rev=481300
==============================================================================
--- geronimo/sandbox/gcache/server/src/main/xsd/catalog.cat (added)
+++ geronimo/sandbox/gcache/server/src/main/xsd/catalog.cat Fri Dec  1 09:06:51 2006
@@ -0,0 +1 @@
+SYSTEM "http://geronimo.apache.org/xml/ns/gcache-1.0.xsd" "../../../../common/src/main/xsd/gcache.xsd"

Copied: geronimo/sandbox/gcache/server/src/main/xsd/gcache-server.xsd (from r477589, geronimo/sandbox/gcache/server/src/main/xsd/gcache.xsd)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gcache/server/src/main/xsd/gcache-server.xsd?view=diff&rev=481300&p1=geronimo/sandbox/gcache/server/src/main/xsd/gcache.xsd&r1=477589&p2=geronimo/sandbox/gcache/server/src/main/xsd/gcache-server.xsd&r2=481300
==============================================================================
--- geronimo/sandbox/gcache/server/src/main/xsd/gcache.xsd (original)
+++ geronimo/sandbox/gcache/server/src/main/xsd/gcache-server.xsd Fri Dec  1 09:06:51 2006
@@ -1,13 +1,28 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<xs:schema xmlns:gcache="http://geronimo.apache.org/xml/ns/gcache-1.0"
+<xs:schema xmlns:gcache-server="http://geronimo.apache.org/xml/ns/gcache-server-1.0"
 	xmlns:xs="http://www.w3.org/2001/XMLSchema"
-	targetNamespace="http://geronimo.apache.org/xml/ns/gcache-1.0"
-	version="1.0" attributeFormDefault="unqualified"
+	xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
+	xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
+	xmlns:gcache="http://geronimo.apache.org/xml/ns/gcache-1.0"
+	targetNamespace="http://geronimo.apache.org/xml/ns/gcache-server-1.0"
+	version="1.0" attributeFormDefault="unqualified" jxb:version="2.0"
+	jxb:extensionBindingPrefixes="xjc"
 	elementFormDefault="qualified">
-	<xs:element name="gcache-config" type="gcache:gcacheConfigType" />
-	<xs:complexType name="gcacheConfigType">
+	
+	<xs:annotation>
+   		<xs:appinfo>
+   			<jxb:globalBindings>
+    			<xjc:simple />
+    		</jxb:globalBindings>
+    	</xs:appinfo>
+    </xs:annotation>
+	
+	<xs:import namespace="http://geronimo.apache.org/xml/ns/gcache-1.0" schemaLocation="http://geronimo.apache.org/xml/ns/gcache-1.0.xsd"/>
+	
+	<xs:element name="gcache-server-config" type="gcache-server:gcacheServerConfig" />
+	<xs:complexType name="gcacheServerConfig">
 		<xs:sequence>
-			<xs:element name="server" type="gcache:serverType"
+			<xs:element name="server" type="gcache-server:serverType"
 				minOccurs="1" maxOccurs="1" />
 			<xs:element name="diskStore" type="gcache:diskStoreType"
 				minOccurs="1" maxOccurs="1" />
@@ -17,6 +32,7 @@
 				minOccurs="0" maxOccurs="unbounded" />
 		</xs:sequence>
 	</xs:complexType>
+	
 	<xs:complexType name="serverType">
 		<xs:sequence>
 			<xs:element name="transport" type="gcache:transportType" />
@@ -30,53 +46,4 @@
 			</xs:simpleType>
 		</xs:attribute>
 	</xs:complexType>
-	<xs:complexType name="transportType">
-		<xs:attribute name="name" use="required" type="xs:NCName" />
-		<xs:attribute name="uri" use="required" type="xs:NCName" />
-		<xs:attribute name="discoveryUri" use="optional"
-			type="xs:NCName" />
-	</xs:complexType>
-	<xs:complexType name="diskStoreType">
-		<xs:attribute name="path" use="required" type="xs:NCName" />
-	</xs:complexType>
-	<xs:complexType name="defaultCacheType">
-		<xs:attribute name="diskExpiryThreadIntervalSeconds"
-			type="xs:int" default="120" />
-		<xs:attribute name="diskPersistent" type="xs:boolean" />
-		<xs:attribute name="eternal" use="required" type="xs:boolean" />
-		<xs:attribute name="maxElementsInMemory" use="required"
-			type="xs:int" />
-		<xs:attribute name="memoryStoreEvictionPolicy"
-			type="gcache:evictionPolicyType" default="LRU" />
-		<xs:attribute name="overflowToDisk" use="required"
-			type="xs:boolean" />
-		<xs:attribute name="timeToIdleSeconds" type="xs:int"
-			default="120" />
-		<xs:attribute name="timeToLiveSeconds" type="xs:int"
-			default="120" />
-	</xs:complexType>
-	<xs:complexType name="cacheType">
-		<xs:attribute name="diskExpiryThreadIntervalSeconds"
-			type="xs:int" default="60" />
-		<xs:attribute name="diskPersistent" type="xs:boolean" />
-		<xs:attribute name="eternal" use="required" type="xs:boolean" />
-		<xs:attribute name="maxElementsInMemory" use="required"
-			type="xs:int" />
-		<xs:attribute name="memoryStoreEvictionPolicy"
-			type="gcache:evictionPolicyType" default="LRU" />
-		<xs:attribute name="name" use="required" type="xs:NCName" />
-		<xs:attribute name="overflowToDisk" use="required"
-			type="xs:boolean" />
-		<xs:attribute name="timeToIdleSeconds" type="xs:int"
-			default="0" />
-		<xs:attribute name="timeToLiveSeconds" type="xs:int"
-			default="0" />
-	</xs:complexType>
-	<xs:simpleType name="evictionPolicyType">
-		<xs:restriction base="xs:string">
-			<xs:enumeration value="FIFO" />
-			<xs:enumeration value="LFU" />
-			<xs:enumeration value="LRU" />
-		</xs:restriction>
-	</xs:simpleType>
 </xs:schema>

Propchange: geronimo/sandbox/gcache/server/src/main/xsd/gcache-server.xsd
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gcache/server/src/main/xsd/gcache-server.xsd
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/sandbox/gcache/server/src/main/xsd/gcache-server.xsd
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: geronimo/sandbox/gcache/server/src/test/java/org/apache/geronimo/gcache/dd/ConfigBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gcache/server/src/test/java/org/apache/geronimo/gcache/dd/ConfigBuilderTest.java?view=diff&rev=481300&r1=481299&r2=481300
==============================================================================
--- geronimo/sandbox/gcache/server/src/test/java/org/apache/geronimo/gcache/dd/ConfigBuilderTest.java
(original)
+++ geronimo/sandbox/gcache/server/src/test/java/org/apache/geronimo/gcache/dd/ConfigBuilderTest.java
Fri Dec  1 09:06:51 2006
@@ -28,10 +28,10 @@
 
     @Test
     public void testConfigBuilder() throws Exception {
-        ConfigBuilder cb = new ConfigBuilder();
+        ServerConfigBuilder cb = new ServerConfigBuilder();
 
         //Pull the configuration
-        GcacheConfiguration config = cb.getConfig(null);
+        GcacheServerConfiguration config = cb.getConfig(null);
 
         //Server and Transport Settings
         assert config.getServerName().equals("gcache");

Modified: geronimo/sandbox/gcache/server/src/test/resources/gcache-server-config.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gcache/server/src/test/resources/gcache-server-config.xml?view=diff&rev=481300&r1=481299&r2=481300
==============================================================================
--- geronimo/sandbox/gcache/server/src/test/resources/gcache-server-config.xml (original)
+++ geronimo/sandbox/gcache/server/src/test/resources/gcache-server-config.xml Fri Dec  1
09:06:51 2006
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<gcache-config>
+<gcache-server-config>
 	<server order="1" serverName="gcache">
 		<transport name="default" uri="tcp://default?enableLogging=true" discoveryUri="multicast://default"
/>
 	</server>
@@ -20,4 +20,4 @@
 		timeToIdleSeconds="0" timeToLiveSeconds="1800" overflowToDisk="false"
 		diskPersistent="true" diskExpiryThreadIntervalSeconds="60"
 		memoryStoreEvictionPolicy="LFU" />
-</gcache-config>
+</gcache-server-config>



Mime
View raw message