Author: david.lloyd(a)jboss.com
Date: 2010-03-02 16:45:22 -0500 (Tue, 02 Mar 2010)
New Revision: 5784
Added:
remoting-mc-int/trunk/metadata/pom.xml
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ClientAuthenticationMetaData.java
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ConnectionMetaData.java
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/EndpointMetaData.java
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/LocalClientMetaData.java
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/RefMetaData.java
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ServerMetaData.java
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ServiceManager.java
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ServiceMetaData.java
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/UserEntryMetaData.java
Removed:
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ClientMetaData.java
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ClientSourceMetaData.java
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/LocalServiceMetaData.java
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/LocateServiceMetaData.java
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/RemoteServiceMetaData.java
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ServiceListenerMetaData.java
Modified:
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/RemotingHelper.java
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/RemotingMetaData.java
remoting-mc-int/trunk/metadata/src/main/resources/META-INF/jboss-remoting_3_1.xsd
Log:
Remoting metadata for 3.1
Added: remoting-mc-int/trunk/metadata/pom.xml
===================================================================
--- remoting-mc-int/trunk/metadata/pom.xml (rev 0)
+++ remoting-mc-int/trunk/metadata/pom.xml 2010-03-02 21:45:22 UTC (rev 5784)
@@ -0,0 +1,99 @@
+<!--
+ ~ JBoss, Home of Professional Open Source
+ ~ Copyright 2010, JBoss Inc., and individual contributors as indicated
+ ~ by the @authors tag. See the copyright.txt in the distribution for a
+ ~ full listing of individual contributors.
+ ~
+ ~ This is free software; you can redistribute it and/or modify it
+ ~ under the terms of the GNU Lesser General Public License as
+ ~ published by the Free Software Foundation; either version 2.1 of
+ ~ the License, or (at your option) any later version.
+ ~
+ ~ This software is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ ~ Lesser General Public License for more details.
+ ~
+ ~ You should have received a copy of the GNU Lesser General Public
+ ~ License along with this software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ -->
+
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <properties>
+ <jbrem.version>3.1.0.Beta1</jbrem.version>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <groupId>org.jboss.remoting</groupId>
+ <name>JBoss Remoting Metadata</name>
+ <artifactId>jboss-remoting-metadata</artifactId>
+ <packaging>jar</packaging>
+ <version>3.1.0.Beta1-SNAPSHOT</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.remoting</groupId>
+ <artifactId>jboss-remoting</artifactId>
+ <version>3.1.0.Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.xnio</groupId>
+ <artifactId>xnio-metadata</artifactId>
+ <version>2.1.0.CR1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.xnio</groupId>
+ <artifactId>xnio-api</artifactId>
+ <version>2.1.0.CR1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.kernel</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ <version>2.2.0.Alpha6</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossxb</artifactId>
+ <version>2.0.2.Beta3</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <distributionManagement>
+ <repository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Maven2 Repository</name>
+ <
url>http://repository.jboss.org/maven2</url>
+ </repository>
+ </distributionManagement>
+</project>
Added:
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ClientAuthenticationMetaData.java
===================================================================
---
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ClientAuthenticationMetaData.java
(rev 0)
+++
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ClientAuthenticationMetaData.java 2010-03-02
21:45:22 UTC (rev 5784)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.jboss.remoting3.metadata;
+
+import javax.xml.bind.annotation.XmlType;
+
+@XmlType(name = "client-authentication")
+public final class ClientAuthenticationMetaData {
+ private UserEntryMetaData userEntry;
+ private RefMetaData callbackHandler;
+
+ public UserEntryMetaData getUserEntry() {
+ return userEntry;
+ }
+
+ public void setUserEntry(final UserEntryMetaData userEntry) {
+ this.userEntry = userEntry;
+ }
+
+ public RefMetaData getCallbackHandler() {
+ return callbackHandler;
+ }
+
+ public void setCallbackHandler(final RefMetaData callbackHandler) {
+ this.callbackHandler = callbackHandler;
+ }
+}
Deleted:
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ClientMetaData.java
===================================================================
---
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ClientMetaData.java 2010-03-02
06:04:36 UTC (rev 5783)
+++
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ClientMetaData.java 2010-03-02
21:45:22 UTC (rev 5784)
@@ -1,73 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.jboss.remoting3.metadata;
-
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlAttribute;
-
-/**
- *
- */
-@XmlType(name = "client")
-public final class ClientMetaData {
- private String name;
- private String serviceBean;
- private String requestClassName;
- private String replyClassName;
-
- public String getName() {
- return name;
- }
-
- @XmlAttribute(required = true)
- public void setName(final String name) {
- this.name = name;
- }
-
- public String getServiceBean() {
- return serviceBean;
- }
-
- @XmlAttribute(name = "service-bean", required = true)
- public void setServiceBean(final String serviceBean) {
- this.serviceBean = serviceBean;
- }
-
- public String getRequestClassName() {
- return requestClassName;
- }
-
- @XmlAttribute(name = "request-class-name")
- public void setRequestClassName(final String requestClassName) {
- this.requestClassName = requestClassName;
- }
-
- public String getReplyClassName() {
- return replyClassName;
- }
-
- @XmlAttribute(name = "reply-class-name")
- public void setReplyClassName(final String replyClassName) {
- this.replyClassName = replyClassName;
- }
-}
Deleted:
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ClientSourceMetaData.java
===================================================================
---
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ClientSourceMetaData.java 2010-03-02
06:04:36 UTC (rev 5783)
+++
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ClientSourceMetaData.java 2010-03-02
21:45:22 UTC (rev 5784)
@@ -1,74 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.jboss.remoting3.metadata;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- *
- */
-@XmlType(name = "client-source")
-public final class ClientSourceMetaData {
- private String name;
- private String serviceBean;
- private String requestClassName;
- private String replyClassName;
-
- public String getName() {
- return name;
- }
-
- @XmlAttribute(required = true)
- public void setName(final String name) {
- this.name = name;
- }
-
- public String getServiceBean() {
- return serviceBean;
- }
-
- @XmlAttribute(name = "service-bean", required = true)
- public void setServiceBean(final String serviceBean) {
- this.serviceBean = serviceBean;
- }
-
- public String getRequestClassName() {
- return requestClassName;
- }
-
- @XmlAttribute(name = "request-class-name")
- public void setRequestClassName(final String requestClassName) {
- this.requestClassName = requestClassName;
- }
-
- public String getReplyClassName() {
- return replyClassName;
- }
-
- @XmlAttribute(name = "reply-class-name")
- public void setReplyClassName(final String replyClassName) {
- this.replyClassName = replyClassName;
- }
-
-}
Added:
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ConnectionMetaData.java
===================================================================
---
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ConnectionMetaData.java
(rev 0)
+++
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ConnectionMetaData.java 2010-03-02
21:45:22 UTC (rev 5784)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.jboss.remoting3.metadata;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.jboss.xnio.metadata.OptionMetaData;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlType(name = "connection", propOrder = {})
+public final class ConnectionMetaData {
+ private RefMetaData destination;
+ private ClientAuthenticationMetaData clientAuthentication;
+ private List<OptionMetaData> options = new ArrayList<OptionMetaData>();
+ private String name;
+
+ public RefMetaData getDestination() {
+ return destination;
+ }
+
+ @XmlElement(required = true)
+ public void setDestination(final RefMetaData destination) {
+ this.destination = destination;
+ }
+
+ public ClientAuthenticationMetaData getClientAuthentication() {
+ return clientAuthentication;
+ }
+
+ @XmlElement(name = "authentication")
+ public void setClientAuthentication(final ClientAuthenticationMetaData
clientAuthentication) {
+ this.clientAuthentication = clientAuthentication;
+ }
+
+ public List<OptionMetaData> getOptions() {
+ return options;
+ }
+
+ @XmlElementWrapper(name = "options")
+ @XmlElement(name = "option", type = OptionMetaData.class)
+ public void setOptions(final List<OptionMetaData> options) {
+ this.options = options;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ @XmlAttribute(required = true)
+ public void setName(final String name) {
+ this.name = name;
+ }
+}
Added:
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/EndpointMetaData.java
===================================================================
---
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/EndpointMetaData.java
(rev 0)
+++
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/EndpointMetaData.java 2010-03-02
21:45:22 UTC (rev 5784)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.jboss.remoting3.metadata;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.jboss.xnio.metadata.OptionMetaData;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlType(name = "endpoint", propOrder = {})
+public final class EndpointMetaData {
+ private RefMetaData executor;
+ private List<OptionMetaData> options = new ArrayList<OptionMetaData>();
+ private String name;
+ private boolean defaultFlag = false;
+
+ public RefMetaData getExecutor() {
+ return executor;
+ }
+
+ @XmlElement(name = "executor")
+ public void setExecutor(final RefMetaData executor) {
+ this.executor = executor;
+ }
+
+ public List<OptionMetaData> getOptions() {
+ return options;
+ }
+
+ @XmlElementWrapper(name = "options")
+ @XmlElement(name = "option", type = OptionMetaData.class)
+ public void setOptions(final List<OptionMetaData> options) {
+ this.options = options;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ @XmlAttribute(required = true)
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ public boolean isDefaultFlag() {
+ return defaultFlag;
+ }
+
+ @XmlAttribute(name = "default")
+ public void setDefaultFlag(final boolean defaultFlag) {
+ this.defaultFlag = defaultFlag;
+ }
+}
Copied:
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/LocalClientMetaData.java
(from rev 5051,
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ClientMetaData.java)
===================================================================
---
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/LocalClientMetaData.java
(rev 0)
+++
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/LocalClientMetaData.java 2010-03-02
21:45:22 UTC (rev 5784)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.jboss.remoting3.metadata;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlAttribute;
+
+/**
+ *
+ */
+@XmlType(name = "client")
+public final class LocalClientMetaData {
+ private String name;
+ private RefMetaData requestClassName;
+ private RefMetaData replyClassName;
+ private RefMetaData requestListener;
+
+ public String getName() {
+ return name;
+ }
+
+ @XmlAttribute(required = true)
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ public RefMetaData getRequestClassName() {
+ return requestClassName;
+ }
+
+ @XmlElement(name = "request-class", required = true)
+ public void setRequestClassName(final RefMetaData requestClassName) {
+ this.requestClassName = requestClassName;
+ }
+
+ public RefMetaData getReplyClassName() {
+ return replyClassName;
+ }
+
+ @XmlElement(name = "reply-class", required = true)
+ public void setReplyClassName(final RefMetaData replyClassName) {
+ this.replyClassName = replyClassName;
+ }
+
+ public RefMetaData getRequestListener() {
+ return requestListener;
+ }
+
+ @XmlElement(name = "request-listener", required = true)
+ public void setRequestListener(final RefMetaData requestListener) {
+ this.requestListener = requestListener;
+ }
+}
Deleted:
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/LocalServiceMetaData.java
===================================================================
---
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/LocalServiceMetaData.java 2010-03-02
06:04:36 UTC (rev 5783)
+++
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/LocalServiceMetaData.java 2010-03-02
21:45:22 UTC (rev 5784)
@@ -1,108 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.jboss.remoting3.metadata;
-
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlAttribute;
-
-/**
- *
- */
-@XmlType(name = "service")
-public final class LocalServiceMetaData implements Cloneable {
-
- private String name;
- private String requestListenerClass;
- private String requestClassName;
- private String replyClassName;
- private String serviceType;
- private String groupName;
- private int metric;
-
- public String getName() {
- return name;
- }
-
- @XmlAttribute(required = true)
- public void setName(final String name) {
- this.name = name;
- }
-
- public String getRequestListenerClass() {
- return requestListenerClass;
- }
-
- @XmlAttribute(name = "request-listener-class")
- public void setRequestListenerClass(final String requestListenerClass) {
- this.requestListenerClass = requestListenerClass;
- }
-
- public String getRequestClassName() {
- return requestClassName;
- }
-
- @XmlAttribute(name = "request-class")
- public void setRequestClassName(final String requestClassName) {
- this.requestClassName = requestClassName;
- }
-
- public String getReplyClassName() {
- return replyClassName;
- }
-
- @XmlAttribute(name = "reply-class")
- public void setReplyClassName(final String replyClassName) {
- this.replyClassName = replyClassName;
- }
-
- public String getServiceType() {
- return serviceType;
- }
-
- @XmlAttribute(name = "service-type", required = true)
- public void setServiceType(final String serviceType) {
- this.serviceType = serviceType;
- }
-
- public String getGroupName() {
- return groupName;
- }
-
- @XmlAttribute(name = "group-name")
- public void setGroupName(final String groupName) {
- this.groupName = groupName;
- }
-
- public int getMetric() {
- return metric;
- }
-
- @XmlAttribute(name = "metric")
- public void setMetric(final int metric) {
- this.metric = metric;
- }
-
- protected LocalServiceMetaData clone() throws CloneNotSupportedException {
- return (LocalServiceMetaData) super.clone();
- }
-}
Deleted:
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/LocateServiceMetaData.java
===================================================================
---
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/LocateServiceMetaData.java 2010-03-02
06:04:36 UTC (rev 5783)
+++
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/LocateServiceMetaData.java 2010-03-02
21:45:22 UTC (rev 5784)
@@ -1,73 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.jboss.remoting3.metadata;
-
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlAttribute;
-
-/**
- *
- */
-@XmlType(name = "locate-service")
-public final class LocateServiceMetaData {
- private String name;
- private String uri;
- private String requestClassName;
- private String replyClassName;
-
- public String getName() {
- return name;
- }
-
- @XmlAttribute(required = true)
- public void setName(final String name) {
- this.name = name;
- }
-
- public String getUri() {
- return uri;
- }
-
- @XmlAttribute(required = true)
- public void setUri(final String uri) {
- this.uri = uri;
- }
-
- public String getRequestClassName() {
- return requestClassName;
- }
-
- @XmlAttribute(name = "request-class-name")
- public void setRequestClassName(final String requestClassName) {
- this.requestClassName = requestClassName;
- }
-
- public String getReplyClassName() {
- return replyClassName;
- }
-
- @XmlAttribute(name = "reply-class-name")
- public void setReplyClassName(final String replyClassName) {
- this.replyClassName = replyClassName;
- }
-}
Added:
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/RefMetaData.java
===================================================================
---
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/RefMetaData.java
(rev 0)
+++
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/RefMetaData.java 2010-03-02
21:45:22 UTC (rev 5784)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.jboss.remoting3.metadata;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlType(name = "ref", propOrder = {})
+public final class RefMetaData {
+ private String name;
+
+ public String getName() {
+ return name;
+ }
+
+ @XmlAttribute(required = true)
+ public void setName(final String name) {
+ this.name = name;
+ }
+}
Deleted:
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/RemoteServiceMetaData.java
===================================================================
---
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/RemoteServiceMetaData.java 2010-03-02
06:04:36 UTC (rev 5783)
+++
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/RemoteServiceMetaData.java 2010-03-02
21:45:22 UTC (rev 5784)
@@ -1,93 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.jboss.remoting3.metadata;
-
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlAttribute;
-
-/**
- *
- */
-@XmlType(name = "remote-service")
-public final class RemoteServiceMetaData {
- private String name;
- private String serviceType;
- private String groupName;
- private String endpointName;
- private String requestHandlerSourceBean;
- private int metric;
-
- public String getName() {
- return name;
- }
-
- @XmlAttribute(required = true)
- public void setName(final String name) {
- this.name = name;
- }
-
- public String getServiceType() {
- return serviceType;
- }
-
- @XmlAttribute(name = "service-type", required = true)
- public void setServiceType(final String serviceType) {
- this.serviceType = serviceType;
- }
-
- public String getGroupName() {
- return groupName;
- }
-
- @XmlAttribute(name = "group-name", required = true)
- public void setGroupName(final String groupName) {
- this.groupName = groupName;
- }
-
- public String getEndpointName() {
- return endpointName;
- }
-
- @XmlAttribute(name = "endpoint-name", required = true)
- public void setEndpointName(final String endpointName) {
- this.endpointName = endpointName;
- }
-
- public String getRequestHandlerSourceBean() {
- return requestHandlerSourceBean;
- }
-
- @XmlAttribute(name = "request-handler-source-bean", required = true)
- public void setRequestHandlerSourceBean(final String requestHandlerSourceBean) {
- this.requestHandlerSourceBean = requestHandlerSourceBean;
- }
-
- public int getMetric() {
- return metric;
- }
-
- @XmlAttribute
- public void setMetric(final int metric) {
- this.metric = metric;
- }
-}
Modified:
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/RemotingHelper.java
===================================================================
---
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/RemotingHelper.java 2010-03-02
06:04:36 UTC (rev 5783)
+++
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/RemotingHelper.java 2010-03-02
21:45:22 UTC (rev 5784)
@@ -22,16 +22,13 @@
package org.jboss.remoting3.metadata;
-import org.jboss.remoting3.spi.RequestHandlerSource;
-import org.jboss.remoting3.spi.Handle;
-import org.jboss.remoting3.spi.RequestHandler;
+import java.net.InetSocketAddress;
import org.jboss.remoting3.Endpoint;
-import org.jboss.remoting3.RequestListener;
-import org.jboss.remoting3.LocalServiceConfiguration;
-import org.jboss.remoting3.Client;
-import org.jboss.remoting3.SimpleCloseable;
-import org.jboss.xnio.IoUtils;
-import java.io.IOException;
+import org.jboss.remoting3.UnknownURISchemeException;
+import org.jboss.remoting3.spi.NetworkServerProvider;
+import org.jboss.xnio.ChannelListener;
+import org.jboss.xnio.OptionMap;
+import org.jboss.xnio.channels.ConnectedStreamChannel;
/**
*
@@ -39,32 +36,7 @@
public final class RemotingHelper {
private RemotingHelper() {}
- @SuppressWarnings({ "unchecked" })
- public static <I, O> Handle<RequestHandlerSource> registerService(final
Endpoint endpoint, final Class<I> requestClass, final Class<O> replyClass,
final Class<? extends RequestListener> listenerClass, final String serviceType,
final String groupName, final int metric) throws IOException, IllegalAccessException,
InstantiationException {
- final RequestListener<I, O> listener = (RequestListener<I, O>)
listenerClass.newInstance();
- final LocalServiceConfiguration<I, O> config = new
LocalServiceConfiguration<I, O>(listener, requestClass, replyClass);
- config.setGroupName(groupName);
- config.setServiceType(serviceType);
- config.setMetric(metric);
- return endpoint.bindLocalService(config);
+ public static ChannelListener<ConnectedStreamChannel<InetSocketAddress>>
createServer(Endpoint endpoint, String protocol, OptionMap optionMap) throws
UnknownURISchemeException {
+ return endpoint.getConnectionProviderInterface(protocol,
NetworkServerProvider.class).getServerListener(optionMap);
}
-
- public static <I, O> Client<I, O> createClient(final Endpoint endpoint,
final RequestHandlerSource handlerSource, final Class<I> requestClass, final
Class<O> replyClass) throws IOException {
- final Handle<RequestHandler> handle =
handlerSource.createRequestHandler();
- try {
- return endpoint.createClient(handle.getResource(), requestClass,
replyClass);
- } finally {
- IoUtils.safeClose(handle);
- }
- }
-
- public static SimpleCloseable registerRemoteService(final Endpoint endpoint, final
String serviceType, final String groupName, final String endpointName, final
RequestHandlerSource requestHandlerSource, final int metric) throws IOException {
- final RemoteServiceConfiguration config = new RemoteServiceConfiguration();
- config.setServiceType(serviceType);
- config.setGroupName(groupName);
- config.setEndpointName(endpointName);
- config.setRequestHandlerSource(requestHandlerSource);
- config.setMetric(metric);
- return endpoint.registerRemoteService(config);
- }
}
Modified:
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/RemotingMetaData.java
===================================================================
---
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/RemotingMetaData.java 2010-03-02
06:04:36 UTC (rev 5783)
+++
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/RemotingMetaData.java 2010-03-02
21:45:22 UTC (rev 5784)
@@ -1,17 +1,24 @@
package org.jboss.remoting3.metadata;
import java.io.Serializable;
+import java.net.URI;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
+import java.util.concurrent.Executor;
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.beans.metadata.api.annotations.Inject;
+import org.jboss.remoting3.Client;
+import org.jboss.remoting3.Connection;
import org.jboss.remoting3.Endpoint;
-import org.jboss.remoting3.ServiceRegistrationListener;
-import org.jboss.remoting3.spi.RequestHandlerSource;
+import org.jboss.remoting3.Remoting;
+import org.jboss.remoting3.RequestListener;
+import org.jboss.remoting3.security.SimpleClientCallbackHandler;
import org.jboss.xb.annotations.JBossXmlSchema;
+import org.jboss.xnio.ChannelListener;
+import org.jboss.xnio.Option;
+import org.jboss.xnio.OptionMap;
+import org.jboss.xnio.metadata.OptionMetaData;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlNsForm;
@@ -20,23 +27,24 @@
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlAttribute;
+import javax.security.auth.callback.CallbackHandler;
+
/**
* Metadata which describes a Remoting deployment. This class is intended for the
parsing of
* {@code jboss-remoting.xml} descriptors.
*/
-@JBossXmlSchema (namespace = "urn:jboss:remoting:3.0", elementFormDefault =
XmlNsForm.QUALIFIED)
+@JBossXmlSchema (namespace = "urn:jboss:remoting:3.1", elementFormDefault =
XmlNsForm.QUALIFIED)
@XmlRootElement (name = "remoting")
-@XmlType (name = "remoting")
+@XmlType (name = "remoting", propOrder = {})
public class RemotingMetaData implements BeanMetaDataFactory, Serializable {
private static final long serialVersionUID = 1L;
private String endpoint;
- private List<LocalServiceMetaData> localServices;
- private List<RemoteServiceMetaData> remoteServices;
- private List<ClientMetaData> clients;
- private List<ClientSourceMetaData> clientSources;
- private List<ServiceListenerMetaData> serviceListeners;
- private ClassLoader classLoader;
+ private List<ServiceMetaData> services = new
ArrayList<ServiceMetaData>();
+ private List<LocalClientMetaData> localClients = new
ArrayList<LocalClientMetaData>();
+ private List<ServerMetaData> servers = new ArrayList<ServerMetaData>();
+ private List<ConnectionMetaData> connections = new
ArrayList<ConnectionMetaData>();
+ private List<EndpointMetaData> endpoints = new
ArrayList<EndpointMetaData>();
public String getEndpoint() {
return endpoint;
@@ -47,149 +55,164 @@
this.endpoint = endpoint;
}
- public List<LocalServiceMetaData> getLocalServices() {
- return localServices;
+ public List<ServiceMetaData> getServices() {
+ return services;
}
@XmlElement(name = "local-service")
- public void setLocalServices(final List<LocalServiceMetaData> localServices) {
- this.localServices = localServices;
+ public void setServices(final List<ServiceMetaData> services) {
+ this.services = services;
}
- public List<RemoteServiceMetaData> getRemoteServices() {
- return remoteServices;
+ public List<LocalClientMetaData> getLocalClients() {
+ return localClients;
}
- @XmlElement(name = "remote-service")
- public void setRemoteServices(final List<RemoteServiceMetaData> remoteServices)
{
- this.remoteServices = remoteServices;
- }
-
- public List<ClientMetaData> getClients() {
- return clients;
- }
-
@XmlElement(name = "client")
- public void setClients(final List<ClientMetaData> clients) {
- this.clients = clients;
+ public void setLocalClients(final List<LocalClientMetaData> localClients) {
+ this.localClients = localClients;
}
- public List<ClientSourceMetaData> getClientSources() {
- return clientSources;
+ public List<ServerMetaData> getServers() {
+ return servers;
}
- @XmlElement(name = "client-source")
- public void setClientSources(final List<ClientSourceMetaData> clientSources) {
- this.clientSources = clientSources;
+ @XmlElement(name = "server")
+ public void setServers(final List<ServerMetaData> servers) {
+ this.servers = servers;
}
- public List<ServiceListenerMetaData> getServiceListeners() {
- return serviceListeners;
+ public List<ConnectionMetaData> getConnections() {
+ return connections;
}
- @XmlElement(name = "service-listener")
- public void setServiceListeners(final List<ServiceListenerMetaData>
serviceListeners) {
- this.serviceListeners = serviceListeners;
+ @XmlElement(name = "connection")
+ public void setConnections(final List<ConnectionMetaData> connections) {
+ this.connections = connections;
}
- public ClassLoader getClassLoader() {
- return classLoader;
+ public List<EndpointMetaData> getEndpoints() {
+ return endpoints;
}
- @Inject
- public void setClassLoader(final ClassLoader classLoader) {
- this.classLoader = classLoader;
+ @XmlElement(name = "endpoint")
+ public void setEndpoints(final List<EndpointMetaData> endpoints) {
+ this.endpoints = endpoints;
}
/**
- * Create a duplicate of this object.
- *
- * @return a duplicate of this object
- */
- public RemotingMetaData clone() throws CloneNotSupportedException {
- final RemotingMetaData metaData = (RemotingMetaData) super.clone();
- metaData.localServices = new
ArrayList<LocalServiceMetaData>(localServices.size());
- for (LocalServiceMetaData localService : localServices) {
- metaData.localServices.add(localService.clone());
- }
- return metaData;
- }
-
- /**
* Get the metadata items that this deployment produces.
*
* @return the list of metadata items
*/
@XmlTransient
public List<BeanMetaData> getBeans() {
- try {
- final ClassLoader classLoader = getClassLoader();
- final String endpoint = this.endpoint == null ?
"default-remoting-endpoint" : this.endpoint;
- final List<BeanMetaData> metaDataList = new
ArrayList<BeanMetaData>();
- for (LocalServiceMetaData localService : localServices) {
- BeanMetaDataBuilder builder =
BeanMetaDataBuilder.createBuilder(localService.getName());
- builder.setFactoryClass(RemotingHelper.class.getName());
- builder.setFactoryMethod("registerService");
- builder.addConstructorParameter(Endpoint.class.getName(),
builder.createInject(endpoint));
- builder.addConstructorParameter(Class.class.getName(),
getOptionalClass(localService.getRequestClassName(), classLoader));
- builder.addConstructorParameter(Class.class.getName(),
getOptionalClass(localService.getReplyClassName(), classLoader));
- builder.addConstructorParameter(Class.class.getName(),
Class.forName(localService.getRequestListenerClass(), false, classLoader));
- builder.addConstructorParameter(String.class.getName(),
localService.getServiceType());
- builder.addConstructorParameter(String.class.getName(),
localService.getGroupName());
- builder.addConstructorParameter(int.class.getName(),
Integer.valueOf(localService.getMetric()));
- builder.setStop("close");
- metaDataList.add(builder.getBeanMetaData());
+ final String endpoint = this.endpoint == null ?
"Remoting:DEFAULT-ENDPOINT" : "Remoting:ENDPOINT:" + this.endpoint;
+ final List<BeanMetaData> metaDataList = new
ArrayList<BeanMetaData>();
+ for (ServiceMetaData service : services) {
+ final String type = service.getType();
+ final String groupName = defaulted(service.getGroupName(),
"default");
+ final BeanMetaDataBuilder builder =
BeanMetaDataBuilder.createBuilder(ServiceManager.class.getName(), "Remoting:" +
endpoint + ":SERVICE:" + type + ":" + groupName);
+ builder.ignoreCreate();
+ builder.ignoreDestroy();
+ builder.setStart("start");
+ builder.setStop("stop");
+ builder.addPropertyMetaData("endpoint",
builder.createInject(endpoint));
+ builder.addPropertyMetaData("requestType",
service.getRequestClassName().getName());
+ builder.addPropertyMetaData("replyType",
service.getReplyClassName().getName());
+ builder.addPropertyMetaData("clientListener",
builder.createInject(service.getClientListener()));
+ builder.addPropertyMetaData("optionMap",
createOptionMap(service.getOptions()));
+ builder.addPropertyMetaData("serviceType", service.getType());
+ final RefMetaData classloader = service.getClassloader();
+ if (classloader != null) builder.addPropertyMetaData("classloader",
builder.createInject(classloader.getName()));
+ builder.addPropertyMetaData("groupName", service.getGroupName());
+ metaDataList.add(builder.getBeanMetaData());
+ }
+ for (LocalClientMetaData localClient : localClients) {
+ final String name = localClient.getName();
+ final BeanMetaDataBuilder builder =
BeanMetaDataBuilder.createBuilder(Client.class.getName(), name);
+ builder.ignoreCreate();
+ builder.ignoreDestroy();
+ builder.ignoreStart();
+ builder.setStop("close");
+ builder.setFactoryClass(Remoting.class.getName());
+ builder.setFactoryMethod("createLocalClient");
+ builder.addConstructorParameter(Endpoint.class.getName(),
builder.createInject(endpoint));
+ builder.addConstructorParameter(RequestListener.class.getName(),
builder.createInject(localClient.getRequestListener().getName()));
+ builder.addConstructorParameter(Class.class.getName(),
localClient.getRequestClassName().getName());
+ metaDataList.add(builder.getBeanMetaData());
+ }
+ for (ServerMetaData server : servers) {
+ final String name = server.getName();
+ final BeanMetaDataBuilder builder =
BeanMetaDataBuilder.createBuilder(ChannelListener.class.getName(), name);
+ builder.ignoreCreate();
+ builder.ignoreDestroy();
+ builder.ignoreStart();
+ builder.ignoreStop();
+ builder.setFactoryClass(RemotingHelper.class.getName());
+ builder.setFactoryMethod("createServer");
+ builder.addConstructorParameter(Endpoint.class.getName(),
builder.createInject(endpoint));
+ builder.addConstructorParameter(String.class.getName(),
server.getProtocol());
+ builder.addConstructorParameter(OptionMap.class.getName(),
createOptionMap(server.getOptions()));
+ metaDataList.add(builder.getBeanMetaData());
+ }
+ for (ConnectionMetaData connection : connections) {
+ final String name = connection.getName();
+ final BeanMetaDataBuilder builder =
BeanMetaDataBuilder.createBuilder(Connection.class.getName(), name);
+ builder.ignoreCreate();
+ builder.ignoreDestroy();
+ builder.ignoreStart();
+ builder.setStop("close");
+ builder.setFactory(endpoint);
+ builder.setFactoryMethod("connect");
+ builder.addConstructorParameter(URI.class.getName(),
URI.create(connection.getDestination().getName()));
+ builder.addConstructorParameter(OptionMap.class.getName(),
createOptionMap(connection.getOptions()));
+ final ClientAuthenticationMetaData auth =
connection.getClientAuthentication();
+ if (auth != null) {
+ final RefMetaData ref = auth.getCallbackHandler();
+ if (ref != null) {
+ builder.addConstructorParameter(CallbackHandler.class.getName(),
builder.createInject(ref.getName()));
+ } else {
+ final UserEntryMetaData entry = auth.getUserEntry();
+ final String password = entry.getPassword();
+ builder.addConstructorParameter(CallbackHandler.class.getName(), new
SimpleClientCallbackHandler(
+ entry.getUserName(), entry.getUserRealm(), password == null ?
null : password.toCharArray()
+ ));
+ }
}
- for (ClientMetaData client : clients) {
- BeanMetaDataBuilder builder =
BeanMetaDataBuilder.createBuilder(client.getName());
- builder.setFactoryClass(RemotingHelper.class.getName());
- builder.setFactoryMethod("createClient");
- builder.addConstructorParameter(Endpoint.class.getName(),
builder.createInject(endpoint));
- builder.addConstructorParameter(RequestHandlerSource.class.getName(),
builder.createInject(client.getServiceBean()));
- builder.addConstructorParameter(Class.class.getName(),
getOptionalClass(client.getRequestClassName(), classLoader));
- builder.addConstructorParameter(Class.class.getName(),
getOptionalClass(client.getReplyClassName(), classLoader));
- builder.setStop("close");
- metaDataList.add(builder.getBeanMetaData());
+ metaDataList.add(builder.getBeanMetaData());
+ }
+ for (EndpointMetaData endpointMetaData : endpoints) {
+ final String name = endpointMetaData.getName();
+ final BeanMetaDataBuilder builder =
BeanMetaDataBuilder.createBuilder(Endpoint.class.getName(), "Remoting:ENDPOINT:"
+ name);
+ if (endpointMetaData.isDefaultFlag()) {
+ builder.addAlias("Remoting:DEFAULT-ENDPOINT");
}
- for (ClientSourceMetaData clientSource : clientSources) {
- BeanMetaDataBuilder builder =
BeanMetaDataBuilder.createBuilder(clientSource.getName());
- builder.setFactory(builder.createInject(endpoint));
- builder.setFactoryMethod("createClientSource");
- builder.addConstructorParameter(RequestHandlerSource.class.getName(),
builder.createInject(clientSource.getServiceBean()));
- builder.addConstructorParameter(Class.class.getName(),
getOptionalClass(clientSource.getRequestClassName(), classLoader));
- builder.addConstructorParameter(Class.class.getName(),
getOptionalClass(clientSource.getReplyClassName(), classLoader));
- builder.setStop("close");
- metaDataList.add(builder.getBeanMetaData());
- }
- for (RemoteServiceMetaData remoteService : remoteServices) {
- BeanMetaDataBuilder builder =
BeanMetaDataBuilder.createBuilder(remoteService.getName());
- builder.setFactoryClass(RemotingHelper.class.getName());
- builder.setFactoryMethod("registerRemoteService");
- builder.addConstructorParameter(Endpoint.class.getName(),
builder.createInject(endpoint));
- builder.addConstructorParameter(String.class.getName(),
remoteService.getServiceType());
- builder.addConstructorParameter(String.class.getName(),
remoteService.getGroupName());
- builder.addConstructorParameter(String.class.getName(),
remoteService.getEndpointName());
- builder.addConstructorParameter(RequestHandlerSource.class.getName(),
builder.createInject(remoteService.getRequestHandlerSourceBean()));
- builder.addConstructorParameter(int.class.getName(),
Integer.valueOf(remoteService.getMetric()));
- builder.setStop("close");
- metaDataList.add(builder.getBeanMetaData());
- }
- for (ServiceListenerMetaData serviceListener : serviceListeners) {
- BeanMetaDataBuilder builder =
BeanMetaDataBuilder.createBuilder(serviceListener.getName());
- builder.setFactory(builder.createInject(endpoint));
- builder.setFactoryMethod("addServiceListener");
-
builder.addConstructorParameter(ServiceRegistrationListener.class.getName(),
builder.createInject(serviceListener.getListenerBean()));
- builder.addConstructorParameter(boolean.class.getName(),
Boolean.valueOf(serviceListener.isOnlyNew()));
- builder.setStop("close");
- metaDataList.add(builder.getBeanMetaData());
- }
- return Collections.unmodifiableList(metaDataList);
- } catch (ClassNotFoundException e) {
- throw new RuntimeException("Cannot find a required class name",
e);
+ builder.ignoreCreate();
+ builder.ignoreDestroy();
+ builder.ignoreStart();
+ builder.setStop("close");
+ builder.setFactoryClass(Remoting.class.getName());
+ builder.setFactoryMethod("createEndpoint");
+ builder.addConstructorParameter(String.class.getName(), name);
+ builder.addConstructorParameter(Executor.class.getName(),
builder.createInject(endpointMetaData.getExecutor().getName()));
+ builder.addConstructorParameter(OptionMap.class.getName(),
createOptionMap(endpointMetaData.getOptions()));
+ metaDataList.add(builder.getBeanMetaData());
}
+ return metaDataList;
}
- private Class<?> getOptionalClass(final String className, final ClassLoader
classLoader) throws ClassNotFoundException {
- return className == null ? Object.class : Class.forName(className, false,
classLoader);
+ private OptionMap createOptionMap(final List<OptionMetaData> options) {
+ if (options.isEmpty()) return OptionMap.EMPTY;
+ final OptionMap.Builder builder = OptionMap.builder();
+ for (OptionMetaData option : options) {
+ final Option<?> real = Option.fromString(option.getClassName() +
"." + option.getName(), Remoting.class.getClassLoader());
+ builder.parse(real, option.getValue());
+ }
+ return builder.getMap();
}
+
+ private static String defaulted(String val, String def) {
+ return val != null ? val : def;
+ }
}
Added:
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ServerMetaData.java
===================================================================
---
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ServerMetaData.java
(rev 0)
+++
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ServerMetaData.java 2010-03-02
21:45:22 UTC (rev 5784)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.jboss.remoting3.metadata;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.jboss.xnio.metadata.OptionMetaData;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlType(name = "server", propOrder = {})
+public final class ServerMetaData {
+ private List<OptionMetaData> options = new ArrayList<OptionMetaData>();
+ private String protocol = "remote";
+ private String name;
+
+ public List<OptionMetaData> getOptions() {
+ return options;
+ }
+
+ @XmlElementWrapper(name = "options")
+ @XmlElement(name = "option", type = OptionMetaData.class)
+ public void setOptions(final List<OptionMetaData> options) {
+ this.options = options;
+ }
+
+ public String getProtocol() {
+ return protocol;
+ }
+
+ @XmlAttribute
+ public void setProtocol(final String protocol) {
+ this.protocol = protocol;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ @XmlAttribute(required = true)
+ public void setName(final String name) {
+ this.name = name;
+ }
+}
Deleted:
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ServiceListenerMetaData.java
===================================================================
---
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ServiceListenerMetaData.java 2010-03-02
06:04:36 UTC (rev 5783)
+++
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ServiceListenerMetaData.java 2010-03-02
21:45:22 UTC (rev 5784)
@@ -1,63 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.jboss.remoting3.metadata;
-
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlAttribute;
-
-/**
- *
- */
-@XmlType(name = "service-listener")
-public final class ServiceListenerMetaData {
- private String name;
- private String listenerBean;
- private boolean onlyNew;
-
- public String getName() {
- return name;
- }
-
- @XmlAttribute(required = true)
- public void setName(final String name) {
- this.name = name;
- }
-
- public String getListenerBean() {
- return listenerBean;
- }
-
- @XmlAttribute(name = "listener-bean", required = true)
- public void setListenerBean(final String listenerBean) {
- this.listenerBean = listenerBean;
- }
-
- public boolean isOnlyNew() {
- return onlyNew;
- }
-
- @XmlAttribute(name = "only-new")
- public void setOnlyNew(final boolean onlyNew) {
- this.onlyNew = onlyNew;
- }
-}
Added:
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ServiceManager.java
===================================================================
---
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ServiceManager.java
(rev 0)
+++
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ServiceManager.java 2010-03-02
21:45:22 UTC (rev 5784)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.jboss.remoting3.metadata;
+
+import java.io.IOException;
+import org.jboss.remoting3.ClientListener;
+import org.jboss.remoting3.Endpoint;
+import org.jboss.remoting3.Registration;
+import org.jboss.xnio.IoUtils;
+import org.jboss.xnio.OptionMap;
+
+public final class ServiceManager<I, O> {
+ private Endpoint endpoint;
+ private Registration serviceRegistration;
+ private Class<I> requestType;
+ private Class<O> replyType;
+ private ClientListener<I, O> clientListener;
+ private OptionMap optionMap;
+ private String serviceType;
+ private String groupName;
+
+ public void setEndpoint(final Endpoint endpoint) {
+ this.endpoint = endpoint;
+ }
+
+ public void setRequestType(final Class<I> requestType) {
+ this.requestType = requestType;
+ }
+
+ public void setReplyType(final Class<O> replyType) {
+ this.replyType = replyType;
+ }
+
+ public void setClientListener(final ClientListener<I, O> clientListener) {
+ this.clientListener = clientListener;
+ }
+
+ public void setOptionMap(final OptionMap optionMap) {
+ this.optionMap = optionMap;
+ }
+
+ public void setServiceType(final String serviceType) {
+ this.serviceType = serviceType;
+ }
+
+ public void setGroupName(final String groupName) {
+ this.groupName = groupName;
+ }
+
+ public void start() throws IOException {
+ final Endpoint.ServiceBuilder<I, O> builder =
endpoint.serviceBuilder(requestType, replyType);
+ builder.setClientListener(clientListener);
+ builder.setOptionMap(optionMap);
+ builder.setServiceType(serviceType);
+ builder.setGroupName(groupName);
+ serviceRegistration = builder.register();
+ }
+
+ public void stop() {
+ IoUtils.safeClose(serviceRegistration);
+ }
+}
Copied:
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ServiceMetaData.java
(from rev 5051,
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/LocalServiceMetaData.java)
===================================================================
---
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ServiceMetaData.java
(rev 0)
+++
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/ServiceMetaData.java 2010-03-02
21:45:22 UTC (rev 5784)
@@ -0,0 +1,111 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.jboss.remoting3.metadata;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.jboss.xnio.metadata.OptionMetaData;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlAttribute;
+
+/**
+ *
+ */
+@XmlType(name = "service", propOrder = {})
+public final class ServiceMetaData {
+
+ private RefMetaData clientListener;
+ private RefMetaData requestClassName;
+ private RefMetaData replyClassName;
+ private RefMetaData classloader;
+ private List<OptionMetaData> options = new ArrayList<OptionMetaData>();
+ private String type;
+ private String groupName;
+
+ public RefMetaData getClientListener() {
+ return clientListener;
+ }
+
+ @XmlElement(name = "client-listener", required = true)
+ public void setClientListener(final RefMetaData clientListener) {
+ this.clientListener = clientListener;
+ }
+
+ public RefMetaData getRequestClassName() {
+ return requestClassName;
+ }
+
+ @XmlElement(name = "request-class", required = true)
+ public void setRequestClassName(final RefMetaData requestClassName) {
+ this.requestClassName = requestClassName;
+ }
+
+ public RefMetaData getReplyClassName() {
+ return replyClassName;
+ }
+
+ @XmlElement(name = "reply-class", required = true)
+ public void setReplyClassName(final RefMetaData replyClassName) {
+ this.replyClassName = replyClassName;
+ }
+
+ public RefMetaData getClassloader() {
+ return classloader;
+ }
+
+ @XmlElement(name = "classloader")
+ public void setClassloader(final RefMetaData classloader) {
+ this.classloader = classloader;
+ }
+
+ public List<OptionMetaData> getOptions() {
+ return options;
+ }
+
+ @XmlElementWrapper(name = "options")
+ @XmlElement(name = "option", type = OptionMetaData.class)
+ public void setOptions(final List<OptionMetaData> options) {
+ this.options = options;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ @XmlAttribute(name = "type", required = true)
+ public void setType(final String type) {
+ this.type = type;
+ }
+
+ public String getGroupName() {
+ return groupName;
+ }
+
+ @XmlAttribute(name = "group-name")
+ public void setGroupName(final String groupName) {
+ this.groupName = groupName;
+ }
+}
Added:
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/UserEntryMetaData.java
===================================================================
---
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/UserEntryMetaData.java
(rev 0)
+++
remoting-mc-int/trunk/metadata/src/main/java/org/jboss/remoting3/metadata/UserEntryMetaData.java 2010-03-02
21:45:22 UTC (rev 5784)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.jboss.remoting3.metadata;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlType(name = "user-entry", propOrder = {})
+public final class UserEntryMetaData {
+ private String userName;
+ private String userRealm;
+ private String password;
+
+ public String getUserName() {
+ return userName;
+ }
+
+ @XmlAttribute(name = "user-name", required = true)
+ public void setUserName(final String userName) {
+ this.userName = userName;
+ }
+
+ public String getUserRealm() {
+ return userRealm;
+ }
+
+ @XmlAttribute(name = "user-realm")
+ public void setUserRealm(final String userRealm) {
+ this.userRealm = userRealm;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ @XmlAttribute
+ public void setPassword(final String password) {
+ this.password = password;
+ }
+}
Modified:
remoting-mc-int/trunk/metadata/src/main/resources/META-INF/jboss-remoting_3_1.xsd
===================================================================
---
remoting-mc-int/trunk/metadata/src/main/resources/META-INF/jboss-remoting_3_1.xsd 2010-03-02
06:04:36 UTC (rev 5783)
+++
remoting-mc-int/trunk/metadata/src/main/resources/META-INF/jboss-remoting_3_1.xsd 2010-03-02
21:45:22 UTC (rev 5784)
@@ -54,6 +54,7 @@
<xs:element name="client-listener" type="ref"/>
<xs:element name="request-class" type="ref"/>
<xs:element name="reply-class" type="ref"/>
+ <xs:element name="classloader" type="ref"
minOccurs="0"/>
<xs:element name="options" type="xnio:optionsType"
minOccurs="0"/>
</xs:all>
<xs:attribute name="type" type="xs:string"
use="required"/>
@@ -97,6 +98,7 @@
<xs:element name="options" type="xnio:optionsType"
minOccurs="0"/>
</xs:all>
<xs:attribute name="name" type="xs:string"
use="required"/>
+ <xs:attribute name="default" type="xs:boolean"
use="optional" default="false"/>
</xs:complexType>
<xs:complexType name="ref">