JBoss Remoting SVN: r3785 - in remoting3/trunk: mc-deployers/src/main/java/org/jboss/cx/remoting and 3 other directories.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-03-26 14:03:17 -0400 (Wed, 26 Mar 2008)
New Revision: 3785
Added:
remoting3/trunk/mc-deployers/src/main/java/org/jboss/cx/remoting/metadata/
remoting3/trunk/mc-deployers/src/main/java/org/jboss/cx/remoting/metadata/EndpointMetaData.java
remoting3/trunk/mc-deployers/src/main/java/org/jboss/cx/remoting/metadata/RemotingMetaData.java
remoting3/trunk/mc-deployers/src/main/resources/META-INF/remoting-deployer-beans.xml
Removed:
remoting3/trunk/mc-deployers/src/main/java/org/jboss/cx/remoting/deployer/
remoting3/trunk/mc-deployers/src/main/resources/META-INF/remoting-endpoint-deployer-beans.xml
remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/UnmodifiableArrayList.java
Modified:
remoting3/trunk/build.properties
remoting3/trunk/build.xml
remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/CollectionUtil.java
Log:
A semi-correct start on deployers
Modified: remoting3/trunk/build.properties
===================================================================
--- remoting3/trunk/build.properties 2008-03-26 08:42:04 UTC (rev 3784)
+++ remoting3/trunk/build.properties 2008-03-26 18:03:17 UTC (rev 3785)
@@ -37,32 +37,51 @@
lib.jboss-common-core.local=${local.repository}/${lib.jboss-common-core.local-path}
lib.jboss-common-core.remote=${remote.repository}/${lib.jboss-common-core.remote-path}
-lib.jbossmc.version=2.0.0.Beta10
+lib.jboss-deployers.version=2.0.0.Beta11
+lib.jboss-deployers.license=lgpl
+lib.jboss-deployers.local-dir=jboss-deployers/${lib.jboss-deployers.version}/lib
+lib.jboss-deployers.remote-dir=jboss/jboss-deployers/${lib.jboss-deployers.version}/lib
+
+lib.jboss-deployers-client.name=jboss-deployers-client.jar
+lib.jboss-deployers-client.license=${lib.jboss-deployers.license}
+lib.jboss-deployers-client.local-path=${lib.jboss-deployers.local-dir}/${lib.jboss-deployers-client.name}
+lib.jboss-deployers-client.remote-path=${lib.jboss-deployers.remote-dir}/${lib.jboss-deployers-client.name}
+lib.jboss-deployers-client.local=${local.repository}/${lib.jboss-deployers-client.local-path}
+lib.jboss-deployers-client.remote=${remote.repository}/${lib.jboss-deployers-client.remote-path}
+
+lib.jboss-deployers-client-spi.name=jboss-deployers-client-spi.jar
+lib.jboss-deployers-client-spi.license=${lib.jboss-deployers.license}
+lib.jboss-deployers-client-spi.local-path=${lib.jboss-deployers.local-dir}/${lib.jboss-deployers-client-spi.name}
+lib.jboss-deployers-client-spi.remote-path=${lib.jboss-deployers.remote-dir}/${lib.jboss-deployers-client-spi.name}
+lib.jboss-deployers-client-spi.local=${local.repository}/${lib.jboss-deployers-client-spi.local-path}
+lib.jboss-deployers-client-spi.remote=${remote.repository}/${lib.jboss-deployers-client-spi.remote-path}
+
+lib.jboss-deployers-core-spi.name=jboss-deployers-core-spi.jar
+lib.jboss-deployers-core-spi.license=${lib.jboss-deployers.license}
+lib.jboss-deployers-core-spi.local-path=${lib.jboss-deployers.local-dir}/${lib.jboss-deployers-core-spi.name}
+lib.jboss-deployers-core-spi.remote-path=${lib.jboss-deployers.remote-dir}/${lib.jboss-deployers-core-spi.name}
+lib.jboss-deployers-core-spi.local=${local.repository}/${lib.jboss-deployers-core-spi.local-path}
+lib.jboss-deployers-core-spi.remote=${remote.repository}/${lib.jboss-deployers-core-spi.remote-path}
+
+lib.jboss-deployers-spi.name=jboss-deployers-spi.jar
+lib.jboss-deployers-spi.license=${lib.jboss-deployers.license}
+lib.jboss-deployers-spi.local-path=${lib.jboss-deployers.local-dir}/${lib.jboss-deployers-spi.name}
+lib.jboss-deployers-spi.remote-path=${lib.jboss-deployers.remote-dir}/${lib.jboss-deployers-spi.name}
+lib.jboss-deployers-spi.local=${local.repository}/${lib.jboss-deployers-spi.local-path}
+lib.jboss-deployers-spi.remote=${remote.repository}/${lib.jboss-deployers-spi.remote-path}
+
+lib.jboss-deployers-structure-spi.name=jboss-deployers-structure-spi.jar
+lib.jboss-deployers-structure-spi.license=${lib.jboss-deployers.license}
+lib.jboss-deployers-structure-spi.local-path=${lib.jboss-deployers.local-dir}/${lib.jboss-deployers-structure-spi.name}
+lib.jboss-deployers-structure-spi.remote-path=${lib.jboss-deployers.remote-dir}/${lib.jboss-deployers-structure-spi.name}
+lib.jboss-deployers-structure-spi.local=${local.repository}/${lib.jboss-deployers-structure-spi.local-path}
+lib.jboss-deployers-structure-spi.remote=${remote.repository}/${lib.jboss-deployers-structure-spi.remote-path}
+
+lib.jbossmc.version=2.0.0.Beta11
lib.jbossmc.license=lgpl
lib.jbossmc.local-dir=jboss-microcontainer/${lib.jbossmc.version}/lib
lib.jbossmc.remote-dir=jboss/microcontainer/${lib.jbossmc.version}/lib
-lib.jbossmc-deployers-core-spi.name=jboss-deployers-core-spi.jar
-lib.jbossmc-deployers-core-spi.license=${lib.jbossmc.license}
-lib.jbossmc-deployers-core-spi.local-path=${lib.jbossmc.local-dir}/${lib.jbossmc-deployers-core-spi.name}
-lib.jbossmc-deployers-core-spi.remote-path=${lib.jbossmc.remote-dir}/${lib.jbossmc-deployers-core-spi.name}
-lib.jbossmc-deployers-core-spi.local=${local.repository}/${lib.jbossmc-deployers-core-spi.local-path}
-lib.jbossmc-deployers-core-spi.remote=${remote.repository}/${lib.jbossmc-deployers-core-spi.remote-path}
-
-lib.jbossmc-deployers-spi.name=jboss-deployers-spi.jar
-lib.jbossmc-deployers-spi.license=${lib.jbossmc.license}
-lib.jbossmc-deployers-spi.local-path=${lib.jbossmc.local-dir}/${lib.jbossmc-deployers-spi.name}
-lib.jbossmc-deployers-spi.remote-path=${lib.jbossmc.remote-dir}/${lib.jbossmc-deployers-spi.name}
-lib.jbossmc-deployers-spi.local=${local.repository}/${lib.jbossmc-deployers-spi.local-path}
-lib.jbossmc-deployers-spi.remote=${remote.repository}/${lib.jbossmc-deployers-spi.remote-path}
-
-lib.jbossmc-deployers-structure-spi.name=jboss-deployers-structure-spi.jar
-lib.jbossmc-deployers-structure-spi.license=${lib.jbossmc.license}
-lib.jbossmc-deployers-structure-spi.local-path=${lib.jbossmc.local-dir}/${lib.jbossmc-deployers-structure-spi.name}
-lib.jbossmc-deployers-structure-spi.remote-path=${lib.jbossmc.remote-dir}/${lib.jbossmc-deployers-structure-spi.name}
-lib.jbossmc-deployers-structure-spi.local=${local.repository}/${lib.jbossmc-deployers-structure-spi.local-path}
-lib.jbossmc-deployers-structure-spi.remote=${remote.repository}/${lib.jbossmc-deployers-structure-spi.remote-path}
-
lib.jbossmc-kernel.name=jboss-kernel.jar
lib.jbossmc-kernel.license=${lib.jbossmc.license}
lib.jbossmc-kernel.local-path=${lib.jbossmc.local-dir}/${lib.jbossmc-kernel.name}
@@ -70,12 +89,15 @@
lib.jbossmc-kernel.local=${local.repository}/${lib.jbossmc-kernel.local-path}
lib.jbossmc-kernel.remote=${remote.repository}/${lib.jbossmc-kernel.remote-path}
-lib.jbossmc-managed.name=jboss-managed.jar
-lib.jbossmc-managed.license=${lib.jbossmc.license}
-lib.jbossmc-managed.local-path=${lib.jbossmc.local-dir}/${lib.jbossmc-managed.name}
-lib.jbossmc-managed.remote-path=${lib.jbossmc.remote-dir}/${lib.jbossmc-managed.name}
-lib.jbossmc-managed.local=${local.repository}/${lib.jbossmc-managed.local-path}
-lib.jbossmc-managed.remote=${remote.repository}/${lib.jbossmc-managed.remote-path}
+lib.jboss-managed.name=jboss-managed.jar
+lib.jboss-managed.version=2.0.0.Beta10.1
+lib.jboss-managed.license=lgpl
+lib.jboss-managed.local-dir=jboss-managed/${lib.jboss-managed.version}/lib
+lib.jboss-managed.remote-dir=jboss/jboss-managed/${lib.jboss-managed.version}/lib
+lib.jboss-managed.local-path=${lib.jboss-managed.local-dir}/${lib.jboss-managed.name}
+lib.jboss-managed.remote-path=${lib.jboss-managed.remote-dir}/${lib.jboss-managed.name}
+lib.jboss-managed.local=${local.repository}/${lib.jboss-managed.local-path}
+lib.jboss-managed.remote=${remote.repository}/${lib.jboss-managed.remote-path}
lib.jbossxb.version=2.0.0.CR5
lib.jbossxb.name=jboss-xml-binding.jar
Modified: remoting3/trunk/build.xml
===================================================================
--- remoting3/trunk/build.xml 2008-03-26 08:42:04 UTC (rev 3784)
+++ remoting3/trunk/build.xml 2008-03-26 18:03:17 UTC (rev 3785)
@@ -45,38 +45,38 @@
<!-- External library: JBoss Microcontainer deployers SPI -->
- <target name="lib.jbossmc-deployers-spi-check">
- <available property="lib.jbossmc-deployers-spi.exists" file="${lib.jbossmc-deployers-spi.local}"/>
+ <target name="lib.jboss-deployers-spi-check">
+ <available property="lib.jboss-deployers-spi.exists" file="${lib.jboss-deployers-spi.local}"/>
</target>
- <target name="lib.jbossmc-deployers-spi" depends="lib.jbossmc-deployers-spi-check" unless="lib.jbossmc-deployers-spi.exists">
- <mkdir dir="${local.repository}/${lib.jbossmc.local-dir}"/>
- <get src="${lib.jbossmc-deployers-spi.remote}" dest="${lib.jbossmc-deployers-spi.local}" usetimestamp="true" ignoreerrors="false"/>
- <get src="${remote.license.dir}/${lib.jbossmc-deployers-spi.license}.txt" dest="${lib.jbossmc-deployers-spi.local}.license.txt" usetimestamp="true" ignoreerrors="false"/>
+ <target name="lib.jboss-deployers-spi" depends="lib.jboss-deployers-spi-check" unless="lib.jboss-deployers-spi.exists">
+ <mkdir dir="${local.repository}/${lib.jboss-deployers.local-dir}"/>
+ <get src="${lib.jboss-deployers-spi.remote}" dest="${lib.jboss-deployers-spi.local}" usetimestamp="true" ignoreerrors="false"/>
+ <get src="${remote.license.dir}/${lib.jboss-deployers-spi.license}.txt" dest="${lib.jboss-deployers-spi.local}.license.txt" usetimestamp="true" ignoreerrors="false"/>
</target>
<!-- External library: JBoss Microcontainer deployers structure SPI -->
- <target name="lib.jbossmc-deployers-structure-spi-check">
- <available property="lib.jbossmc-deployers-structure-spi.exists" file="${lib.jbossmc-deployers-structure-spi.local}"/>
+ <target name="lib.jboss-deployers-structure-spi-check">
+ <available property="lib.jboss-deployers-structure-spi.exists" file="${lib.jboss-deployers-structure-spi.local}"/>
</target>
- <target name="lib.jbossmc-deployers-structure-spi" depends="lib.jbossmc-deployers-structure-spi-check" unless="lib.jbossmc-deployers-structure-spi.exists">
- <mkdir dir="${local.repository}/${lib.jbossmc.local-dir}"/>
- <get src="${lib.jbossmc-deployers-structure-spi.remote}" dest="${lib.jbossmc-deployers-structure-spi.local}" usetimestamp="true" ignoreerrors="false"/>
- <get src="${remote.license.dir}/${lib.jbossmc-deployers-structure-spi.license}.txt" dest="${lib.jbossmc-deployers-structure-spi.local}.license.txt" usetimestamp="true" ignoreerrors="false"/>
+ <target name="lib.jboss-deployers-structure-spi" depends="lib.jboss-deployers-structure-spi-check" unless="lib.jboss-deployers-structure-spi.exists">
+ <mkdir dir="${local.repository}/${lib.jboss-deployers.local-dir}"/>
+ <get src="${lib.jboss-deployers-structure-spi.remote}" dest="${lib.jboss-deployers-structure-spi.local}" usetimestamp="true" ignoreerrors="false"/>
+ <get src="${remote.license.dir}/${lib.jboss-deployers-structure-spi.license}.txt" dest="${lib.jboss-deployers-structure-spi.local}.license.txt" usetimestamp="true" ignoreerrors="false"/>
</target>
<!-- External library: JBoss Microcontainer deployers core SPI -->
- <target name="lib.jbossmc-deployers-core-spi-check">
- <available property="lib.jbossmc-deployers-core-spi.exists" file="${lib.jbossmc-deployers-core-spi.local}"/>
+ <target name="lib.jboss-deployers-core-spi-check">
+ <available property="lib.jboss-deployers-core-spi.exists" file="${lib.jboss-deployers-core-spi.local}"/>
</target>
- <target name="lib.jbossmc-deployers-core-spi" depends="lib.jbossmc-deployers-core-spi-check" unless="lib.jbossmc-deployers-core-spi.exists">
- <mkdir dir="${local.repository}/${lib.jbossmc.local-dir}"/>
- <get src="${lib.jbossmc-deployers-core-spi.remote}" dest="${lib.jbossmc-deployers-core-spi.local}" usetimestamp="true" ignoreerrors="false"/>
- <get src="${remote.license.dir}/${lib.jbossmc-deployers-core-spi.license}.txt" dest="${lib.jbossmc-deployers-core-spi.local}.license.txt" usetimestamp="true" ignoreerrors="false"/>
+ <target name="lib.jboss-deployers-core-spi" depends="lib.jboss-deployers-core-spi-check" unless="lib.jboss-deployers-core-spi.exists">
+ <mkdir dir="${local.repository}/${lib.jboss-deployers.local-dir}"/>
+ <get src="${lib.jboss-deployers-core-spi.remote}" dest="${lib.jboss-deployers-core-spi.local}" usetimestamp="true" ignoreerrors="false"/>
+ <get src="${remote.license.dir}/${lib.jboss-deployers-core-spi.license}.txt" dest="${lib.jboss-deployers-core-spi.local}.license.txt" usetimestamp="true" ignoreerrors="false"/>
</target>
<!-- External library: JBoss Microcontainer kernel -->
@@ -93,14 +93,14 @@
<!-- External library: JBoss Microcontainer managed -->
- <target name="lib.jbossmc-managed-check">
- <available property="lib.jbossmc-managed.exists" file="${lib.jbossmc-managed.local}"/>
+ <target name="lib.jboss-managed-check">
+ <available property="lib.jboss-managed.exists" file="${lib.jboss-managed.local}"/>
</target>
- <target name="lib.jbossmc-managed" depends="lib.jbossmc-managed-check" unless="lib.jbossmc-managed.exists">
- <mkdir dir="${local.repository}/${lib.jbossmc.local-dir}"/>
- <get src="${lib.jbossmc-managed.remote}" dest="${lib.jbossmc-managed.local}" usetimestamp="true" ignoreerrors="false"/>
- <get src="${remote.license.dir}/${lib.jbossmc-managed.license}.txt" dest="${lib.jbossmc-managed.local}.license.txt" usetimestamp="true" ignoreerrors="false"/>
+ <target name="lib.jboss-managed" depends="lib.jboss-managed-check" unless="lib.jboss-managed.exists">
+ <mkdir dir="${local.repository}/${lib.jboss-managed.local-dir}"/>
+ <get src="${lib.jboss-managed.remote}" dest="${lib.jboss-managed.local}" usetimestamp="true" ignoreerrors="false"/>
+ <get src="${remote.license.dir}/${lib.jboss-managed.license}.txt" dest="${lib.jboss-managed.local}.license.txt" usetimestamp="true" ignoreerrors="false"/>
</target>
<!-- External library: JBossXB -->
@@ -662,11 +662,11 @@
<pathelement location="${lib.jaxb-api.local}"/>
<pathelement location="${lib.jboss-common-logging-spi.local}"/>
<pathelement location="${lib.jboss-common-core.local}"/>
- <pathelement location="${lib.jbossmc-deployers-core-spi.local}"/>
- <pathelement location="${lib.jbossmc-deployers-spi.local}"/>
- <pathelement location="${lib.jbossmc-deployers-structure-spi.local}"/>
+ <pathelement location="${lib.jboss-deployers-core-spi.local}"/>
+ <pathelement location="${lib.jboss-deployers-spi.local}"/>
+ <pathelement location="${lib.jboss-deployers-structure-spi.local}"/>
<pathelement location="${lib.jbossmc-kernel.local}"/>
- <pathelement location="${lib.jbossmc-managed.local}"/>
+ <pathelement location="${lib.jboss-managed.local}"/>
<pathelement location="${lib.jbossxb.local}"/>
</classpath>
</javac>
@@ -677,7 +677,7 @@
<delete dir="mc-deployers/target"/>
</target>
- <target name="mc-deployers" description="Build the mc-deployers module" depends="lib.jaxb-api,lib.jboss-common-core,lib.jboss-common-logging-spi,lib.jbossmc-deployers-core-spi,lib.jbossmc-deployers-spi,lib.jbossmc-deployers-structure-spi,lib.jbossmc-kernel,lib.jbossmc-managed,lib.jbossxb,api,core,log-jboss,util,mc-deployers.compile">
+ <target name="mc-deployers" description="Build the mc-deployers module" depends="lib.jaxb-api,lib.jboss-common-core,lib.jboss-common-logging-spi,lib.jboss-deployers-core-spi,lib.jboss-deployers-spi,lib.jboss-deployers-structure-spi,lib.jbossmc-kernel,lib.jboss-managed,lib.jbossxb,api,core,log-jboss,util,mc-deployers.compile">
<path id="mc-deployers.classpath">
<pathelement location="mc-deployers/target/main/classes"/>
</path>
@@ -1210,7 +1210,7 @@
<!-- fetch: These should be the second-to-last targets in the file -->
- <target name="all-fetch" description="Pre-fetch all external libraries" depends="lib.jboss-common-core,lib.jboss-common-logging-spi,lib.jbossmc-deployers-core-spi,lib.jbossmc-deployers-spi,lib.jbossmc-deployers-structure-spi,lib.jbossmc-kernel,lib.jbossmc-managed,lib.jbossxb,lib.mina,lib.servlet"/>
+ <target name="all-fetch" description="Pre-fetch all external libraries" depends="lib.jboss-common-core,lib.jboss-common-logging-spi,lib.jboss-deployers-core-spi,lib.jboss-deployers-spi,lib.jboss-deployers-structure-spi,lib.jbossmc-kernel,lib.jboss-managed,lib.jbossxb,lib.mina,lib.servlet"/>
<!-- all: These should be the last targets in the file -->
Copied: remoting3/trunk/mc-deployers/src/main/java/org/jboss/cx/remoting/metadata (from rev 3636, remoting3/trunk/mc-deployers/src/main/java/org/jboss/cx/remoting/deployer)
Added: remoting3/trunk/mc-deployers/src/main/java/org/jboss/cx/remoting/metadata/EndpointMetaData.java
===================================================================
--- remoting3/trunk/mc-deployers/src/main/java/org/jboss/cx/remoting/metadata/EndpointMetaData.java (rev 0)
+++ remoting3/trunk/mc-deployers/src/main/java/org/jboss/cx/remoting/metadata/EndpointMetaData.java 2008-03-26 18:03:17 UTC (rev 3785)
@@ -0,0 +1,77 @@
+package org.jboss.cx.remoting.metadata;
+
+import java.io.Serializable;
+import java.util.List;
+import org.jboss.beans.metadata.plugins.AbstractInjectionValueMetaData;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.BeanMetaDataFactory;
+import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
+import org.jboss.cx.remoting.util.CollectionUtil;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ *
+ */
+@XmlType(name = "endpoint")
+public class EndpointMetaData implements BeanMetaDataFactory, Serializable {
+ private static final long serialVersionUID = 1L;
+
+ private String name;
+ private String executorName;
+ private String rootRequestListenerName;
+
+ public String getName() {
+ return name;
+ }
+
+ @XmlAttribute
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ public String getExecutorName() {
+ return executorName;
+ }
+
+ @XmlAttribute(name = "executor")
+ public void setExecutorName(final String executorName) {
+ this.executorName = executorName;
+ }
+
+ public String getRootRequestListenerName() {
+ return rootRequestListenerName;
+ }
+
+ @XmlAttribute(name = "rootRequestListener")
+ public void setRootRequestListenerName(final String rootRequestListenerName) {
+ this.rootRequestListenerName = rootRequestListenerName;
+ }
+
+ public EndpointMetaData clone() throws CloneNotSupportedException {
+ return (EndpointMetaData) super.clone();
+ }
+
+ public List<BeanMetaData> getBeans() {
+ final String userEndpointName = "Endpoint:" + name;
+ final String coreEndpointName = "CoreEndpoint:" + name;
+ final String jrppProtocolSupportName = "JrppProtocolSupport:" + name;
+
+ BeanMetaDataBuilder builder;
+ builder = BeanMetaDataBuilder.createBuilder(coreEndpointName);
+ builder.addConstructorParameter("java.lang.String", name);
+ builder.addConstructorParameter("org.jboss.cx.remoting.RequestListener", builder.createInject(rootRequestListenerName));
+ builder.addPropertyMetaData("executor", builder.createInject(executorName));
+ final BeanMetaData coreEndpointMetaData = builder.getBeanMetaData();
+ builder = BeanMetaDataBuilder.createBuilder(userEndpointName);
+ builder.setFactory(coreEndpointName, "userEndpoint");
+ final BeanMetaData endpointMetaData = builder.getBeanMetaData();
+ builder = BeanMetaDataBuilder.createBuilder(jrppProtocolSupportName);
+ builder.addPropertyMetaData("executor", builder.createInject(executorName));
+ builder.addPropertyMetaData("endpoint", builder.createInject(userEndpointName));
+ final BeanMetaData jrppSupportMetaData = builder.getBeanMetaData();
+
+ return CollectionUtil.unmodifiableList(coreEndpointMetaData, endpointMetaData, jrppSupportMetaData);
+ }
+}
Added: remoting3/trunk/mc-deployers/src/main/java/org/jboss/cx/remoting/metadata/RemotingMetaData.java
===================================================================
--- remoting3/trunk/mc-deployers/src/main/java/org/jboss/cx/remoting/metadata/RemotingMetaData.java (rev 0)
+++ remoting3/trunk/mc-deployers/src/main/java/org/jboss/cx/remoting/metadata/RemotingMetaData.java 2008-03-26 18:03:17 UTC (rev 3785)
@@ -0,0 +1,63 @@
+package org.jboss.cx.remoting.metadata;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.BeanMetaDataFactory;
+import org.jboss.cx.remoting.util.CollectionUtil;
+import org.jboss.xb.annotations.JBossXmlSchema;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ *
+ */
+@JBossXmlSchema (namespace = "urn:jboss:remoting:3.0", elementFormDefault = XmlNsForm.QUALIFIED)
+@XmlRootElement (name = "remoting")
+@XmlType (name = "remoting")
+public class RemotingMetaData implements BeanMetaDataFactory, Serializable {
+ private static final long serialVersionUID = 1L;
+
+ private List<EndpointMetaData> endpoints;
+
+ /**
+ * Get the list of nested endpoints as metadata.
+ *
+ * @return the endpoint metadata list
+ */
+ public List<EndpointMetaData> getEndpoints() {
+ return endpoints;
+ }
+
+ /**
+ * Set the list of nested endpoint metadata.
+ *
+ * @param endpoints the endpoint metadata list
+ */
+ @XmlElement(name = "endpoint")
+ public void setEndpoints(final List<EndpointMetaData> endpoints) {
+ this.endpoints = endpoints;
+ }
+
+ public RemotingMetaData clone() throws CloneNotSupportedException {
+ final RemotingMetaData metaData = (RemotingMetaData) super.clone();
+ metaData.endpoints = new ArrayList<EndpointMetaData>();
+ for (EndpointMetaData endpointMetaData : endpoints) {
+ metaData.endpoints.add(endpointMetaData.clone());
+ }
+ return metaData;
+ }
+
+ public List<BeanMetaData> getBeans() {
+ final List<BeanMetaData> metaDataList = CollectionUtil.arrayList();
+ for (EndpointMetaData endpointMetaData : endpoints) {
+ metaDataList.addAll(endpointMetaData.getBeans());
+ }
+ return Collections.unmodifiableList(metaDataList);
+ }
+}
Copied: remoting3/trunk/mc-deployers/src/main/resources/META-INF/remoting-deployer-beans.xml (from rev 3636, remoting3/trunk/mc-deployers/src/main/resources/META-INF/remoting-endpoint-deployer-beans.xml)
===================================================================
--- remoting3/trunk/mc-deployers/src/main/resources/META-INF/remoting-deployer-beans.xml (rev 0)
+++ remoting3/trunk/mc-deployers/src/main/resources/META-INF/remoting-deployer-beans.xml 2008-03-26 18:03:17 UTC (rev 3785)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ JBoss Remoting Deployer
+-->
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+ <bean name="RemotingMetaDataParser" class="org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer">
+ <constructor>
+ <parameter>org.jboss.cx.remoting.metadata.RemotingMetaData</parameter>
+ </constructor>
+ <property name="name">jboss-remoting.xml</property>
+ <property name="registerWithJBossXB">true</property>
+ <!-- TODO - build management info from annotations -->
+ </bean>
+</deployment>
\ No newline at end of file
Deleted: remoting3/trunk/mc-deployers/src/main/resources/META-INF/remoting-endpoint-deployer-beans.xml
===================================================================
--- remoting3/trunk/mc-deployers/src/main/resources/META-INF/remoting-endpoint-deployer-beans.xml 2008-03-26 08:42:04 UTC (rev 3784)
+++ remoting3/trunk/mc-deployers/src/main/resources/META-INF/remoting-endpoint-deployer-beans.xml 2008-03-26 18:03:17 UTC (rev 3785)
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- JBoss Remoting Deployer
--->
-
-<deployment xmlns="urn:jboss:bean-deployer:2.0">
- <bean name="JBossRemotingEndpointProvider" class="org.jboss.cx.remoting.core.CoreEndpointProvider"/>
-
- <bean name="JBossRemotingEndpointDeployer" class="org.jboss.cx.remoting.deployer.EndpointDeployer">
- <property name="type">jbr-endpoint</property>
- <property name="relativeOrder">500</property>
- <property name="provider"><inject bean="JBossRemotingEndpointProvider"/></property>
- </bean>
-
-</deployment>
\ No newline at end of file
Modified: remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/CollectionUtil.java
===================================================================
--- remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/CollectionUtil.java 2008-03-26 08:42:04 UTC (rev 3784)
+++ remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/CollectionUtil.java 2008-03-26 18:03:17 UTC (rev 3785)
@@ -15,6 +15,7 @@
import java.util.Collection;
import java.util.LinkedList;
import java.util.EnumMap;
+import java.util.Arrays;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
@@ -190,8 +191,8 @@
* @param entries the array
* @return an unmodifiable list
*/
- public static <T> List<T> unmodifiableList(final T[] entries) {
- return new UnmodifiableArrayList<T>(entries);
+ public static <T> List<T> unmodifiableList(final T... entries) {
+ return Collections.unmodifiableList(Arrays.asList(entries));
}
/**
@@ -321,6 +322,21 @@
}
/**
+ * Run a translation function for each element of a {@code List}, returning an {@code ArrayList}.
+ *
+ * @param input the input list
+ * @param translator the translator
+ * @return the translated data
+ */
+ public static <I,O> ArrayList<O> translate(final List<I> input, final Translator<I, O> translator) {
+ final ArrayList<O> output = new ArrayList<O>(input.size());
+ for (I item : input) {
+ output.add(translator.translate(item));
+ }
+ return output;
+ }
+
+ /**
* Create an iterable view of a string split by a given delimiter.
*
* @param delimiter the delimiter
Deleted: remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/UnmodifiableArrayList.java
===================================================================
--- remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/UnmodifiableArrayList.java 2008-03-26 08:42:04 UTC (rev 3784)
+++ remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/UnmodifiableArrayList.java 2008-03-26 18:03:17 UTC (rev 3785)
@@ -1,143 +0,0 @@
-package org.jboss.cx.remoting.util;
-
-import java.util.AbstractList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-
-/**
- *
- */
-public final class UnmodifiableArrayList<T> extends AbstractList<T> implements List<T> {
-
- private final Object[] entries;
- private final int offs;
- private final int length;
-
- <T> UnmodifiableArrayList(final T[] entries) {
- this.entries = entries;
- offs = 0;
- length = entries.length;
- }
-
- <T> UnmodifiableArrayList(final T[] entries, int offs, int length) {
- if (offs > entries.length) {
- throw new IndexOutOfBoundsException("Specified offset is greater than array length");
- }
- if (offs + length > entries.length) {
- throw new IndexOutOfBoundsException("Specified offset + length is greater than array length");
- }
- this.entries = entries;
- this.offs = offs;
- this.length = length;
- }
-
- public int size() {
- return length;
- }
-
- public boolean isEmpty() {
- return length == 0;
- }
-
- public boolean contains(final Object o) {
- for (int i = 0; i < length; i ++) {
- final Object e = entries[i + offs];
- if (o==null ? e==null : o.equals(e)) {
- return true;
- }
- }
- return false;
- }
-
- public Iterator<T> iterator() {
- return new ListIteratorImpl<T>();
- }
-
- @SuppressWarnings ({"unchecked"})
- public T get(final int index) {
- if (index >= length || index < 0) {
- throw new IndexOutOfBoundsException("Invalid get() index: " + index + " (size is " + length + ")");
- }
- return (T) entries[offs + index];
- }
-
- public ListIterator<T> listIterator() {
- return new ListIteratorImpl<T>();
- }
-
- public ListIterator<T> listIterator(final int index) {
- return new ListIteratorImpl<T>(index);
- }
-
- public List<T> subList(final int fromIndex, final int toIndex) {
- if (fromIndex < 0 || fromIndex > length) {
- throw new IndexOutOfBoundsException("fromIndex " + fromIndex + " is not within the bounds of the list (size is " + length + ")");
- }
- if (toIndex < 0 || toIndex > length) {
- throw new IndexOutOfBoundsException("toIndex " + toIndex + " is not within the bounds of the list (size is " + length + ")");
- }
- if (fromIndex > toIndex) {
- throw new IllegalArgumentException("fromIndex " + fromIndex + " is greater than toIndex " + toIndex);
- }
- return new UnmodifiableArrayList<T>(entries, offs + fromIndex, toIndex - fromIndex);
- }
-
- public final class ListIteratorImpl<T> implements ListIterator<T> {
- private int i;
-
- private ListIteratorImpl(final int index) {
- i = index;
- }
-
- private ListIteratorImpl() {
- }
-
- public boolean hasNext() {
- return i < length;
- }
-
- @SuppressWarnings ({"unchecked"})
- public T next() {
- if (i < length) {
- return (T) entries[offs + i++];
- } else {
- throw new NoSuchElementException("next() past end of iterator");
- }
- }
-
- public boolean hasPrevious() {
- return i > 0;
- }
-
- @SuppressWarnings ({"unchecked"})
- public T previous() {
- if (i > 0) {
- return (T) entries[offs + i--];
- } else {
- throw new NoSuchElementException("next() past end of iterator");
- }
- }
-
- public int nextIndex() {
- return i;
- }
-
- public int previousIndex() {
- return i - 1;
- }
-
- public void remove() {
- throw new UnsupportedOperationException("remove() not allowed");
- }
-
- public void set(final T o) {
- throw new UnsupportedOperationException("set() not allowed");
- }
-
- public void add(final T o) {
- throw new UnsupportedOperationException("add() not allowed");
- }
- }
-}
16 years, 9 months
JBoss Remoting SVN: r3784 - remoting2/branches/2.x.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-26 04:42:04 -0400 (Wed, 26 Mar 2008)
New Revision: 3784
Modified:
remoting2/branches/2.x/test.policy
Log:
JBREM-920: Added some permissions, generalized others.
Modified: remoting2/branches/2.x/test.policy
===================================================================
--- remoting2/branches/2.x/test.policy 2008-03-26 08:24:42 UTC (rev 3783)
+++ remoting2/branches/2.x/test.policy 2008-03-26 08:42:04 UTC (rev 3784)
@@ -17,14 +17,15 @@
permission javax.management.MBeanTrustPermission "register";
permission javax.management.MBeanPermission "javax.management.MBeanServerDelegate#MBeanServerId[JMImplementation:type=MBeanServerDelegate]", "getAttribute";
permission javax.management.MBeanPermission "-#-[-]", "queryMBeans";
- permission javax.management.MBeanPermission "org.jboss.remoting.transport.Connector#-[jboss.remoting:transport=socket,type=Connector]", "queryMBeans, isInstanceOf";
- permission javax.management.MBeanPermission "org.jboss.remoting.transport.Connector#-[jboss.remoting:transport=sslsocket,type=Connector]", "queryMBeans, isInstanceOf";
+ permission javax.management.MBeanPermission "org.jboss.remoting.transport.Connector#-[jboss.remoting:type=Connector,*]", "queryMBeans, isInstanceOf";
+ permission javax.management.MBeanPermission "org.jboss.remoting.ServerInvoker#-[jboss.remoting:service=invoker,*]", "unregisterMBean, registerMBean, queryMBeans, isInstanceOf";
permission javax.management.MBeanPermission "javax.management.MBeanServerDelegate#-[JMImplementation:type=MBeanServerDelegate]", "queryMBeans, isInstanceOf, getAttribute";
permission javax.management.MBeanPermission "org.jboss.remoting.detection.multicast.MulticastDetector#-[remoting:type=JNDIDetector]", "queryMBeans, isInstanceOf";
permission javax.management.MBeanPermission "org.jboss.remoting.detection.multicast.MulticastDetector#-[remoting:type=MulticastDetector]", "queryMBeans, isInstanceOf, unregisterMBean";
permission javax.management.MBeanPermission "org.jboss.remoting.network.NetworkRegistry#-[remoting:type=NetworkRegistry]", "queryMBeans, isInstanceOf";
permission javax.management.MBeanPermission "org.jboss.remoting.network.NetworkRegistry#Servers[remoting:type=NetworkRegistry]", "getAttribute";
-
+ permission javax.management.MBeanPermission "-#ServerDataDir[jboss.system:type=ServerConfig]", "getAttribute";
+
// TODO: Figure out why these aren't covered by the AllPermission entries below
permission javax.management.MBeanPermission "org.jboss.test.remoting.detection.metadata.MetadataTestCase$TestNetworkRegistry#-[remoting:type=NetworkRegistry]", "unregisterMBean, registerMBean, queryMBeans, isInstanceOf";
@@ -50,7 +51,15 @@
permission java.util.PropertyPermission "http.basic.username", "read";
permission java.util.PropertyPermission "http.basic.password", "read";
permission java.util.PropertyPermission "org.jboss.remoting.defaultSocketFactory", "read";
-
+ permission java.util.PropertyPermission "jboss.server.data.dir", "read";
+ permission java.util.PropertyPermission "file.separator", "read";
+ permission java.util.PropertyPermission "jboss.remoting.compression.debug", "read";
+ permission java.util.PropertyPermission "jboss.remoting.compression.min", "read";
+ permission java.util.PropertyPermission "remoting.stream.transport", "read";
+ permission java.util.PropertyPermission "remoting.stream.host", "read";
+ permission java.util.PropertyPermission "remoting.stream.port", "read";
+ permission java.util.PropertyPermission "org.jboss.security.ignoreHttpsHost" , "read";
+
// Tomcat native - TODO - this should be in a privileged block in jbossnative
permission java.lang.RuntimePermission "loadLibrary.tcnative-1";
permission java.lang.RuntimePermission "loadLibrary.libtcnative-1";
@@ -60,6 +69,9 @@
permission java.io.FilePermission "${build.home}/output/tests/classes/-", "read";
permission java.io.FilePermission "${build.home}", "read";
permission java.io.FilePermission "${build.home}/jboss.identity", "read";
+
+ // Permission for org.jboss.remoting.ident.Identity to create "jboss.identity" file. Could be extended.
+ permission java.io.FilePermission "${build.home}", "write";
// Used by org.jboss.util.propertyeditor.PropertyEditors.mapJavaBeanProperties(), though still a Remoting permission I think
permission java.lang.RuntimePermission "accessClassInPackage.sun.beans.editors";
@@ -109,11 +121,7 @@
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
permission javax.management.MBeanServerPermission "createMBeanServer, findMBeanServer";
permission javax.management.MBeanTrustPermission "register";
- permission javax.management.MBeanPermission "org.jboss.remoting.transport.socket.SocketServerInvoker#-[jboss.remoting:host=127.0.0.1,*,service=invoker,transport=socket]", "unregisterMBean, registerMBean, queryMBeans, isInstanceOf";
- permission javax.management.MBeanPermission "org.jboss.remoting.transport.socket.SocketServerInvoker#-[jboss.remoting:host=localhost,*,service=invoker,transport=socket]", "unregisterMBean, registerMBean, queryMBeans, isInstanceOf";
- permission javax.management.MBeanPermission "org.jboss.remoting.transport.socket.SocketServerInvoker#-[jboss.remoting:host=\"[::1]\",*,service=invoker,transport=socket]", "unregisterMBean, registerMBean, queryMBeans, isInstanceOf";
- permission javax.management.MBeanPermission "org.jboss.remoting.transport.socket.SocketServerInvoker#-[jboss.remoting:host=\"[::ffff:127.0.0.1]\",*,service=invoker,transport=socket]", "unregisterMBean, registerMBean, queryMBeans, isInstanceOf";
- permission javax.management.MBeanPermission "org.jboss.remoting.transport.socket.SocketServerInvoker#-[jboss.remoting:host=\"[::]\",*,service=invoker,transport=socket]", "unregisterMBean, registerMBean, queryMBeans, isInstanceOf";
+ permission javax.management.MBeanPermission "org.jboss.remoting.ServerInvoker#-[jboss.remoting:service=invoker,*]", "unregisterMBean, registerMBean, queryMBeans, isInstanceOf";
permission javax.management.MBeanPermission "org.jboss.remoting.transport.Connector#-[jboss.remoting:*,transport=socket,type=Connector]", "registerMBean, unregisterMBean, queryMBeans, isInstanceOf";
permission javax.management.MBeanPermission "org.jboss.remoting.transport.Connector#-[jboss.remoting:transport=socket,type=Connector]", "registerMBean, unregisterMBean, queryMBeans, isInstanceOf";
permission javax.management.MBeanPermission "org.jboss.remoting.transport.Connector#-[test:type=connector]", "registerMBean";
16 years, 9 months
JBoss Remoting SVN: r3783 - remoting2/branches/2.x/src/main/org/jboss/remoting/ident.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-26 04:24:42 -0400 (Wed, 26 Mar 2008)
New Revision: 3783
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/ident/Identity.java
Log:
JBREM-934: Put File.mkdirs(), System.getProperty(), and MBeanServer.getAttribute() in AccessController.doPrivileged() calls.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/ident/Identity.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/ident/Identity.java 2008-03-26 08:16:00 UTC (rev 3782)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/ident/Identity.java 2008-03-26 08:24:42 UTC (rev 3783)
@@ -21,6 +21,7 @@
*/
package org.jboss.remoting.ident;
+import org.jboss.remoting.loading.ClassByteClassLoader;
import org.jboss.remoting.network.NetworkRegistry;
import javax.management.MBeanServer;
@@ -264,10 +265,17 @@
}
}
- private static final synchronized String createId(MBeanServer server)
+ private static final synchronized String createId(final MBeanServer server)
{
// we can set as a system property
- String myid = System.getProperty("jboss.identity");
+ String myid = (String)AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ return System.getProperty("jboss.identity");
+ }
+ });
+
if(myid != null)
{
return myid;
@@ -277,13 +285,37 @@
try
{
// FIRST TRY THE JBOSS guy to determine our data directory
- ObjectName obj = new ObjectName("jboss.system:type=ServerConfig");
- File dir = (File) server.getAttribute(obj, "ServerDataDir");
+ final ObjectName obj = new ObjectName("jboss.system:type=ServerConfig");
+ File dir = null;
+
+ try
+ {
+ dir = (File)AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return server.getAttribute(obj, "ServerDataDir");
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw (Exception) e.getCause();
+ }
+
if(dir != null)
{
if(dir.exists() == false)
{
- dir.mkdirs();
+ final File finalDir = dir;
+ AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ finalDir.mkdirs();
+ return null;
+ }
+ });
}
file = new File(dir, "jboss.identity");
}
@@ -321,7 +353,6 @@
return null;
}
});
-
}
file = new File(dir, "jboss.identity");
}
16 years, 9 months
JBoss Remoting SVN: r3782 - remoting2/branches/2.x/src/main/org/jboss/remoting/ident.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-26 04:16:00 -0400 (Wed, 26 Mar 2008)
New Revision: 3782
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/ident/Identity.java
Log:
JBREM-934: Put File.mkdirs() in AccessController.doPrivileged() calls.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/ident/Identity.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/ident/Identity.java 2008-03-26 07:34:27 UTC (rev 3781)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/ident/Identity.java 2008-03-26 08:16:00 UTC (rev 3782)
@@ -35,6 +35,7 @@
import java.net.InetAddress;
import java.rmi.dgc.VMID;
import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.Iterator;
@@ -309,10 +310,18 @@
e.printStackTrace();
}
- File dir = new File(fl);
+ final File dir = new File(fl);
if(dir.exists() == false)
{
- dir.mkdirs();
+ AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ dir.mkdirs();
+ return null;
+ }
+ });
+
}
file = new File(dir, "jboss.identity");
}
16 years, 9 months
JBoss Remoting SVN: r3781 - remoting2/branches/2.x.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-26 03:34:27 -0400 (Wed, 26 Mar 2008)
New Revision: 3781
Modified:
remoting2/branches/2.x/test.policy
Log:
JBREM-920: Added a couple of test suite permissions.
Modified: remoting2/branches/2.x/test.policy
===================================================================
--- remoting2/branches/2.x/test.policy 2008-03-26 07:26:54 UTC (rev 3780)
+++ remoting2/branches/2.x/test.policy 2008-03-26 07:34:27 UTC (rev 3781)
@@ -117,13 +117,15 @@
permission javax.management.MBeanPermission "org.jboss.remoting.transport.Connector#-[jboss.remoting:*,transport=socket,type=Connector]", "registerMBean, unregisterMBean, queryMBeans, isInstanceOf";
permission javax.management.MBeanPermission "org.jboss.remoting.transport.Connector#-[jboss.remoting:transport=socket,type=Connector]", "registerMBean, unregisterMBean, queryMBeans, isInstanceOf";
permission javax.management.MBeanPermission "org.jboss.remoting.transport.Connector#-[test:type=connector]", "registerMBean";
- permission javax.management.MBeanPermission "org.jboss.test.remoting.detection.metadata.MetadataTestCase$TestNetworkRegistry#-[remoting:type=NetworkRegistry]", "registerMBean, unregisterMBean, queryMBeans, isInstanceOf";
+ permission javax.management.MBeanPermission "org.jboss.test.remoting.detection.metadata.MetadataTestCase$TestNetworkRegistry#-[remoting:type=NetworkRegistry]", "registerMBean, unregisterMBean, queryMBeans, isInstanceOf, addNotificationListener";
permission javax.management.MBeanPermission "org.jboss.remoting.network.NetworkRegistry#-[remoting:type=NetworkRegistry]", "registerMBean, unregisterMBean, queryMBeans, isInstanceOf";
permission javax.management.MBeanPermission "org.jboss.remoting.detection.multicast.MulticastDetector#-[remoting:type=JNDIDetector]", "registerMBean, queryMBeans, isInstanceOf";
permission javax.management.MBeanPermission "org.jboss.remoting.detection.multicast.MulticastDetector#-[remoting:type=MulticastDetector]", "registerMBean, queryMBeans, isInstanceOf";
permission javax.management.MBeanPermission "org.jboss.remoting.detection.multicast.MulticastDetector#-[remoting:type=MulticastDetector]", "registerMBean, queryMBeans, isInstanceOf";
permission javax.management.MBeanPermission "org.jboss.remoting.security.SSLServerSocketFactoryService#-[jboss:type=serversocketfactory]", "registerMBean, queryMBeans, isInstanceOf";
permission javax.management.MBeanPermission "org.jboss.test.remoting.transport.config.FactoryConfigTestCaseParent$SelfIdentifyingServerSocketFactory#-[jboss:type=serversocketfactory]", "registerMBean, queryMBeans, isInstanceOf";
+ permission javax.management.MBeanPermission "org.jboss.remoting.security.SSLServerSocketFactoryService#-[jboss:type=serversocketfactory2]", "registerMBean";
+
permission java.lang.RuntimePermission "enableContextClassLoaderOverride";
permission java.lang.RuntimePermission "createClassLoader";
permission java.lang.RuntimePermission "getClassLoader";
16 years, 9 months
JBoss Remoting SVN: r3780 - remoting2/branches/2.x.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-26 03:26:54 -0400 (Wed, 26 Mar 2008)
New Revision: 3780
Modified:
remoting2/branches/2.x/test.policy
Log:
JBREM-920: Added another System property used by HTTPClientInvoker.
Modified: remoting2/branches/2.x/test.policy
===================================================================
--- remoting2/branches/2.x/test.policy 2008-03-26 07:24:49 UTC (rev 3779)
+++ remoting2/branches/2.x/test.policy 2008-03-26 07:26:54 UTC (rev 3780)
@@ -48,6 +48,7 @@
permission java.util.PropertyPermission "jboss.remoting.domain", "write";
permission java.util.PropertyPermission "SERIALIZATION", "read";
permission java.util.PropertyPermission "http.basic.username", "read";
+ permission java.util.PropertyPermission "http.basic.password", "read";
permission java.util.PropertyPermission "org.jboss.remoting.defaultSocketFactory", "read";
// Tomcat native - TODO - this should be in a privileged block in jbossnative
16 years, 9 months
JBoss Remoting SVN: r3779 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-26 03:24:49 -0400 (Wed, 26 Mar 2008)
New Revision: 3779
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http/HTTPClientInvoker.java
Log:
JBREM-934: Put System.getProperty() in AccessController.doPrivileged() calls.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http/HTTPClientInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http/HTTPClientInvoker.java 2008-03-26 05:28:46 UTC (rev 3778)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http/HTTPClientInvoker.java 2008-03-26 07:24:49 UTC (rev 3779)
@@ -868,7 +868,20 @@
}
if (username == null || username.length() == 0)
{
- username = System.getProperty("http.basic.username");
+ try
+ {
+ username = (String)AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return System.getProperty("http.basic.username");
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ log.debug("error", e.getCause());
+ }
}
if (metadata != null)
{
@@ -876,7 +889,20 @@
}
if (password == null)
{
- password = System.getProperty("http.basic.password");
+ try
+ {
+ password = (String)AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return System.getProperty("http.basic.password");
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ log.debug("error", e.getCause());
+ }
}
if (username != null && password != null)
16 years, 9 months
JBoss Remoting SVN: r3778 - remoting2/branches/2.x/src/main/org/jboss/remoting/transporter.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-26 01:28:46 -0400 (Wed, 26 Mar 2008)
New Revision: 3778
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transporter/TransporterHandler.java
Log:
JBREM-934: Put Class.getMethod() in AccessController.doPrivileged() call.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transporter/TransporterHandler.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transporter/TransporterHandler.java 2008-03-26 05:28:29 UTC (rev 3777)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transporter/TransporterHandler.java 2008-03-26 05:28:46 UTC (rev 3778)
@@ -29,6 +29,9 @@
import javax.management.MBeanServer;
import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
/**
* Simple handler that uses reflection to make calls on target POJO (as supplied in the constructor)
@@ -61,10 +64,10 @@
// Am expecting a NameBasedInvocation as the parameter
NameBasedInvocation nbInvocation = (NameBasedInvocation) request;
- String methodName = nbInvocation.getMethodName();
+ final String methodName = nbInvocation.getMethodName();
Object[] params = nbInvocation.getParameters();
String[] sig = nbInvocation.getSignature();
- Class[] classSig = new Class[sig.length];
+ final Class[] classSig = new Class[sig.length];
for(int x = 0; x < sig.length; x++)
{
Class signature = getPrimitiveType(sig[x]);
@@ -79,7 +82,22 @@
}
// use reflection to make the call
- Method method = targetPOJO.getClass().getMethod(methodName, classSig);
+ Method method = null;
+ try
+ {
+ method = (Method)AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return targetPOJO.getClass().getMethod(methodName, classSig);
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw (Exception) e.getCause();
+ }
+
Object responseObject = method.invoke(targetPOJO, params);
return responseObject;
16 years, 9 months
JBoss Remoting SVN: r3777 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/servlet/web.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-26 01:28:29 -0400 (Wed, 26 Mar 2008)
New Revision: 3777
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/servlet/web/ServerInvokerServlet.java
Log:
JBREM-934: Put Class.getMethod() in AccessController.doPrivileged() call.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/servlet/web/ServerInvokerServlet.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/servlet/web/ServerInvokerServlet.java 2008-03-26 05:28:07 UTC (rev 3776)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/servlet/web/ServerInvokerServlet.java 2008-03-26 05:28:29 UTC (rev 3777)
@@ -43,6 +43,9 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
import java.util.Iterator;
/**
@@ -269,8 +272,24 @@
{
try
{
- Class c = Class.forName("java.lang.management.ManagementFactory");
- Method m = c.getMethod("getPlatformMBeanServer", new Class[] {});
+ final Class c = Class.forName("java.lang.management.ManagementFactory");
+ Method m = null;
+
+ try
+ {
+ m = (Method)AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return c.getMethod("getPlatformMBeanServer", new Class[] {});
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw (Exception) e.getCause();
+ }
+
MBeanServer s = (MBeanServer) m.invoke(null, new Object[] {});
log.debug("Using platform MBeanServer");
return s;
16 years, 9 months
JBoss Remoting SVN: r3776 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-26 01:28:07 -0400 (Wed, 26 Mar 2008)
New Revision: 3776
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http/HTTPClientInvoker.java
Log:
JBREM-934: Put Class.getMethod() in AccessController.doPrivileged() calls.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http/HTTPClientInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http/HTTPClientInvoker.java 2008-03-26 05:27:26 UTC (rev 3775)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http/HTTPClientInvoker.java 2008-03-26 05:28:07 UTC (rev 3776)
@@ -500,7 +500,7 @@
return result;
}
- private void setChunked(Map metadata, HttpURLConnection conn)
+ private void setChunked(Map metadata, final HttpURLConnection conn)
{
String chunkedValue = (String) metadata.get("chunkedLength");
if (chunkedValue != null && chunkedValue.length() > 0)
@@ -515,7 +515,23 @@
*/
try
{
- Method setChunkedLengthMethod = conn.getClass().getMethod("setChunkedStreamingMode", new Class[]{int.class});
+ Method setChunkedLengthMethod = null;
+
+ try
+ {
+ setChunkedLengthMethod = (Method)AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return conn.getClass().getMethod("setChunkedStreamingMode", new Class[]{int.class});
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw (Exception) e.getCause();
+ }
+
setChunkedLengthMethod.invoke(conn, new Object[]{new Integer(chunkedLength)});
}
catch (NoSuchMethodException e)
@@ -532,6 +548,12 @@
log.error("Error setting http client connection chunked length.");
log.debug(e);
}
+ catch (Exception e)
+ {
+ // Unexpected.
+ log.error("Unexpected error setting http client connection chunked length.");
+ log.debug(e);
+ }
}
catch (NumberFormatException e)
{
@@ -725,7 +747,7 @@
*/
try
{
- Class proxyClass = ClassLoaderUtility.loadClass("java.net.Proxy", HTTPClientInvoker.class);
+ final Class proxyClass = ClassLoaderUtility.loadClass("java.net.Proxy", HTTPClientInvoker.class);
InetSocketAddress proxyAddress = new InetSocketAddress(proxyHost, proxyPort);
Class[] decalredClasses = proxyClass.getDeclaredClasses();
Class proxyTypeClass = null;
@@ -753,7 +775,23 @@
}
Constructor proxyConstructor = proxyClass.getConstructor(new Class[] {proxyTypeClass, SocketAddress.class});
Object proxy = proxyConstructor.newInstance(new Object[] {proxyType, proxyAddress});
- Method openConnection = externalURL.getClass().getMethod("openConnection", new Class[] {proxyClass});
+ Method openConnection = null;
+
+ try
+ {
+ openConnection = (Method)AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return URL.class.getMethod("openConnection", new Class[] {proxyClass});
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw (Exception) e.getCause();
+ }
+
httpURLConn = (HttpURLConnection)openConnection.invoke(externalURL, new Object[] {proxy});
}
catch (Exception e)
16 years, 9 months