001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.annotation.ejb;
023:
024: import java.lang.annotation.Annotation;
025: import java.util.ArrayList;
026:
027: import javax.ejb.ActivationConfigProperty;
028: import javax.ejb.MessageDriven;
029:
030: import org.jboss.annotation.ejb.RemoteBinding;
031:
032: /**
033: * Comment
034: *
035: * @author <a href="mailto:bill@jboss.org">Bill Burke</a>
036: * @version $Revision: 57207 $
037: */
038: public class RemoteBindingImpl implements RemoteBinding {
039: private String jndi;
040: private String stack;
041: private String bindUrl;
042: private Class proxyFactory;
043:
044: public RemoteBindingImpl() {
045: jndi = "";
046: stack = "";
047: bindUrl = "";
048: proxyFactory = org.jboss.ejb3.remoting.RemoteProxyFactory.class;
049: }
050:
051: public RemoteBindingImpl(String jndi, String stack, String bindUrl,
052: Class proxyFactory) {
053: this .jndi = jndi;
054: this .stack = stack;
055: this .bindUrl = bindUrl;
056: this .proxyFactory = proxyFactory;
057: }
058:
059: public void setStack(String stack) {
060: this .stack = stack;
061: }
062:
063: public void setFactory(Class factory) {
064: this .proxyFactory = factory;
065: }
066:
067: public void setJndiBinding(String jndi) {
068: this .jndi = jndi;
069: }
070:
071: public void setBindUrl(String bindUrl) {
072: this .bindUrl = bindUrl;
073: }
074:
075: public String jndiBinding() {
076: return jndi;
077: }
078:
079: public String interceptorStack() {
080: return stack;
081: }
082:
083: public String clientBindUrl() {
084: return bindUrl;
085: }
086:
087: public Class factory() {
088: return proxyFactory;
089: }
090:
091: public void merge(RemoteBinding annotation) {
092: if (jndi.length() == 0)
093: jndi = annotation.jndiBinding();
094:
095: if (stack.length() == 0)
096: stack = annotation.interceptorStack();
097:
098: if (bindUrl.length() == 0)
099: bindUrl = annotation.clientBindUrl();
100:
101: if (proxyFactory == org.jboss.ejb3.remoting.RemoteProxyFactory.class)
102: proxyFactory = annotation.factory();
103:
104: }
105:
106: public Class<? extends Annotation> annotationType() {
107: return null;
108: }
109:
110: public String toString() {
111: StringBuffer sb = new StringBuffer(100);
112: sb.append("[RemoteBindingImpl:");
113: sb.append(", jndi=" + jndi);
114: sb.append(", stack=" + stack);
115: sb.append(", bindUrl=" + bindUrl);
116: sb.append(", proxyFactory=" + proxyFactory);
117: sb.append(']');
118: return sb.toString();
119: }
120: }
|