You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by ju...@apache.org on 2006/12/07 16:24:09 UTC
svn commit: r483484 - in /jackrabbit/trunk/jackrabbit-jcr-rmi/src:
main/java/org/apache/jackrabbit/rmi/server/jmx/JCRServer.java
main/java/org/apache/jackrabbit/rmi/server/jmx/JCRServerMBean.java
resources/jackrabbit-rmi-service.xml
Author: jukka
Date: Thu Dec 7 07:24:07 2006
New Revision: 483484
URL: http://svn.apache.org/viewvc?view=rev&rev=483484
Log:
jackrabbit-jcr-rmi: Fixed svn:eol-style settings
Modified:
jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/jmx/JCRServer.java (contents, props changed)
jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/jmx/JCRServerMBean.java (contents, props changed)
jackrabbit/trunk/jackrabbit-jcr-rmi/src/resources/jackrabbit-rmi-service.xml (contents, props changed)
Modified: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/jmx/JCRServer.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/jmx/JCRServer.java?view=diff&rev=483484&r1=483483&r2=483484
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/jmx/JCRServer.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/jmx/JCRServer.java Thu Dec 7 07:24:07 2006
@@ -1,149 +1,149 @@
-/*
- * 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.jackrabbit.rmi.server.jmx;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.util.Properties;
-
-import javax.jcr.Repository;
-import javax.naming.InitialContext;
-
-import org.apache.jackrabbit.rmi.remote.RemoteRepository;
-import org.apache.jackrabbit.rmi.server.RemoteAdapterFactory;
-import org.apache.jackrabbit.rmi.server.ServerAdapterFactory;
-
-/**
- * MBean that registers a JCR RMI server through JNDI.
- */
-public class JCRServer implements JCRServerMBean {
-
- /**
- * local repository address
- */
- private String localAddress;
-
- /**
- * remote repository address
- */
- private String remoteAddress;
-
- /**
- * Optional local JNDI environment properties
- */
- private String localEnvironment;
-
- /**
- * Optional remote JNDI environment properties
- */
- private String remoteEnvironment;
-
- /**
- * Remote repository instance
- */
- RemoteRepository remote;
-
- public void start() throws Exception {
-
- if (this.localAddress == null) {
- throw new IllegalStateException("local repository address is null");
- }
-
- if (this.remoteAddress == null) {
- throw new IllegalStateException("remote repository address is null");
- }
-
- // local repository
- InitialContext localContext = createInitialContext(localEnvironment);
- Repository localRepository = (Repository) localContext
- .lookup(this.localAddress);
- if (localRepository == null) {
- throw new IllegalArgumentException("local repository not found at "
- + this.localAddress);
- }
-
- // remote repository
- InitialContext remoteContext = createInitialContext(remoteEnvironment);
- RemoteAdapterFactory factory = new ServerAdapterFactory();
- remote = factory.getRemoteRepository(localRepository);
-
- // bind remote server
- remoteContext.bind(this.remoteAddress, remote);
- }
-
- /**
- *
- * @param jndiProps
- * jndi environment properties
- * @return an InitialContext for the given environment properties
- * @throws Exception
- * if any error occurs
- */
- private InitialContext createInitialContext(String jndiProps)
- throws Exception {
- InitialContext initialContext = null;
- if (jndiProps != null) {
- InputStream is = new ByteArrayInputStream(jndiProps.getBytes());
- Properties props = new Properties();
- props.load(is);
- initialContext = new InitialContext(props);
- } else {
- initialContext = new InitialContext();
- }
- return initialContext;
- }
-
- public void stop() throws Exception {
- // unbind remote server
- InitialContext ctx = new InitialContext();
- ctx.unbind(this.remoteAddress);
- remote = null;
- }
-
- public String getLocalAddress() {
- return localAddress;
- }
-
- public void setLocalAddress(String localAddress) {
- this.localAddress = localAddress;
- }
-
- public String getRemoteAddress() {
- return remoteAddress;
- }
-
- public void setRemoteAddress(String remoteAddress) {
- this.remoteAddress = remoteAddress;
- }
-
- public String getLocalEnvironment() {
- return localEnvironment;
- }
-
- public void setLocalEnvironment(String localEnvironment) {
- this.localEnvironment = localEnvironment;
- }
-
- public String getRemoteEnvironment() {
- return remoteEnvironment;
- }
-
- public void setRemoteEnvironment(String remoteEnvironment) {
- this.remoteEnvironment = remoteEnvironment;
- }
-
-}
+/*
+ * 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.jackrabbit.rmi.server.jmx;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.Properties;
+
+import javax.jcr.Repository;
+import javax.naming.InitialContext;
+
+import org.apache.jackrabbit.rmi.remote.RemoteRepository;
+import org.apache.jackrabbit.rmi.server.RemoteAdapterFactory;
+import org.apache.jackrabbit.rmi.server.ServerAdapterFactory;
+
+/**
+ * MBean that registers a JCR RMI server through JNDI.
+ */
+public class JCRServer implements JCRServerMBean {
+
+ /**
+ * local repository address
+ */
+ private String localAddress;
+
+ /**
+ * remote repository address
+ */
+ private String remoteAddress;
+
+ /**
+ * Optional local JNDI environment properties
+ */
+ private String localEnvironment;
+
+ /**
+ * Optional remote JNDI environment properties
+ */
+ private String remoteEnvironment;
+
+ /**
+ * Remote repository instance
+ */
+ RemoteRepository remote;
+
+ public void start() throws Exception {
+
+ if (this.localAddress == null) {
+ throw new IllegalStateException("local repository address is null");
+ }
+
+ if (this.remoteAddress == null) {
+ throw new IllegalStateException("remote repository address is null");
+ }
+
+ // local repository
+ InitialContext localContext = createInitialContext(localEnvironment);
+ Repository localRepository = (Repository) localContext
+ .lookup(this.localAddress);
+ if (localRepository == null) {
+ throw new IllegalArgumentException("local repository not found at "
+ + this.localAddress);
+ }
+
+ // remote repository
+ InitialContext remoteContext = createInitialContext(remoteEnvironment);
+ RemoteAdapterFactory factory = new ServerAdapterFactory();
+ remote = factory.getRemoteRepository(localRepository);
+
+ // bind remote server
+ remoteContext.bind(this.remoteAddress, remote);
+ }
+
+ /**
+ *
+ * @param jndiProps
+ * jndi environment properties
+ * @return an InitialContext for the given environment properties
+ * @throws Exception
+ * if any error occurs
+ */
+ private InitialContext createInitialContext(String jndiProps)
+ throws Exception {
+ InitialContext initialContext = null;
+ if (jndiProps != null) {
+ InputStream is = new ByteArrayInputStream(jndiProps.getBytes());
+ Properties props = new Properties();
+ props.load(is);
+ initialContext = new InitialContext(props);
+ } else {
+ initialContext = new InitialContext();
+ }
+ return initialContext;
+ }
+
+ public void stop() throws Exception {
+ // unbind remote server
+ InitialContext ctx = new InitialContext();
+ ctx.unbind(this.remoteAddress);
+ remote = null;
+ }
+
+ public String getLocalAddress() {
+ return localAddress;
+ }
+
+ public void setLocalAddress(String localAddress) {
+ this.localAddress = localAddress;
+ }
+
+ public String getRemoteAddress() {
+ return remoteAddress;
+ }
+
+ public void setRemoteAddress(String remoteAddress) {
+ this.remoteAddress = remoteAddress;
+ }
+
+ public String getLocalEnvironment() {
+ return localEnvironment;
+ }
+
+ public void setLocalEnvironment(String localEnvironment) {
+ this.localEnvironment = localEnvironment;
+ }
+
+ public String getRemoteEnvironment() {
+ return remoteEnvironment;
+ }
+
+ public void setRemoteEnvironment(String remoteEnvironment) {
+ this.remoteEnvironment = remoteEnvironment;
+ }
+
+}
Propchange: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/jmx/JCRServer.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/jmx/JCRServerMBean.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/jmx/JCRServerMBean.java?view=diff&rev=483484&r1=483483&r2=483484
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/jmx/JCRServerMBean.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/jmx/JCRServerMBean.java Thu Dec 7 07:24:07 2006
@@ -1,41 +1,41 @@
-/*
- * 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.jackrabbit.rmi.server.jmx;
-
-public interface JCRServerMBean {
-
- public void start() throws Exception;
-
- public void stop() throws Exception;
-
- public String getLocalAddress();
-
- public void setLocalAddress(String address);
-
- public String getRemoteAddress();
-
- public void setRemoteAddress(String address);
-
- public String getRemoteEnvironment();
-
- public void setRemoteEnvironment(String remoteEnvironment);
-
- public String getLocalEnvironment();
-
- public void setLocalEnvironment(String localEnvironment);
-
-}
+/*
+ * 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.jackrabbit.rmi.server.jmx;
+
+public interface JCRServerMBean {
+
+ public void start() throws Exception;
+
+ public void stop() throws Exception;
+
+ public String getLocalAddress();
+
+ public void setLocalAddress(String address);
+
+ public String getRemoteAddress();
+
+ public void setRemoteAddress(String address);
+
+ public String getRemoteEnvironment();
+
+ public void setRemoteEnvironment(String remoteEnvironment);
+
+ public String getLocalEnvironment();
+
+ public void setLocalEnvironment(String localEnvironment);
+
+}
Propchange: jackrabbit/trunk/jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/jmx/JCRServerMBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: jackrabbit/trunk/jackrabbit-jcr-rmi/src/resources/jackrabbit-rmi-service.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-rmi/src/resources/jackrabbit-rmi-service.xml?view=diff&rev=483484&r1=483483&r2=483484
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-rmi/src/resources/jackrabbit-rmi-service.xml (original)
+++ jackrabbit/trunk/jackrabbit-jcr-rmi/src/resources/jackrabbit-rmi-service.xml Thu Dec 7 07:24:07 2006
@@ -1,41 +1,41 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- 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.
- -->
-
-<server>
- <mbean code="org.apache.jackrabbit.rmi.server.jmx.JCRServer"
- name="Jackrabbit.services:RMIServer = JCR RMI Server">
- <attribute name="LocalAddress">java:jcr/local</attribute>
- <attribute name="RemoteAddress">jnp://localhost:1099/jcrServer</attribute>
- <!-- Optional attribute
- <attribute name="LocalEnvironment">
- java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
- java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
- java.naming.provider.url=localhost:1099
- </attribute>
- -->
- <!-- Optional attribute
- <attribute name="RemoteEnvironment">
- java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
- java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
- java.naming.provider.url=localhost:1099
- </attribute>
- -->
- <depends>jboss.jca:service=ManagedConnectionFactory,name=jcr/local</depends>
- </mbean>
-</server>
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ 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.
+ -->
+
+<server>
+ <mbean code="org.apache.jackrabbit.rmi.server.jmx.JCRServer"
+ name="Jackrabbit.services:RMIServer = JCR RMI Server">
+ <attribute name="LocalAddress">java:jcr/local</attribute>
+ <attribute name="RemoteAddress">jnp://localhost:1099/jcrServer</attribute>
+ <!-- Optional attribute
+ <attribute name="LocalEnvironment">
+ java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+ java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+ java.naming.provider.url=localhost:1099
+ </attribute>
+ -->
+ <!-- Optional attribute
+ <attribute name="RemoteEnvironment">
+ java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+ java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+ java.naming.provider.url=localhost:1099
+ </attribute>
+ -->
+ <depends>jboss.jca:service=ManagedConnectionFactory,name=jcr/local</depends>
+ </mbean>
+</server>
Propchange: jackrabbit/trunk/jackrabbit-jcr-rmi/src/resources/jackrabbit-rmi-service.xml
------------------------------------------------------------------------------
svn:eol-style = native