1. /*
  2. * Copyright 2002-2004 the original author or authors.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package org.springframework.remoting.caucho;
  17. import java.net.MalformedURLException;
  18. import org.springframework.aop.framework.ProxyFactory;
  19. import org.springframework.beans.factory.FactoryBean;
  20. /**
  21. * Factory bean for Burlap proxies. Behaves like the proxied service when
  22. * used as bean reference, exposing the specified service interface.
  23. *
  24. * <p>The service URL must be an HTTP URL exposing a Burlap service.
  25. * For details, see BurlapClientInterceptor docs.
  26. *
  27. * @author Juergen Hoeller
  28. * @since 13.05.2003
  29. * @see BurlapServiceExporter
  30. */
  31. public class BurlapProxyFactoryBean extends BurlapClientInterceptor implements FactoryBean {
  32. private Object serviceProxy;
  33. public void afterPropertiesSet() throws MalformedURLException {
  34. super.afterPropertiesSet();
  35. this.serviceProxy = ProxyFactory.getProxy(getServiceInterface(), this);
  36. }
  37. public Object getObject() {
  38. return this.serviceProxy;
  39. }
  40. public Class getObjectType() {
  41. return (this.serviceProxy != null) ? this.serviceProxy.getClass() : getServiceInterface();
  42. }
  43. public boolean isSingleton() {
  44. return true;
  45. }
  46. }