Package org.jboss.aop.proxy

Examples of org.jboss.aop.proxy.ClassProxy


         throw new NotFoundInDispatcherException(oid);
      }

      if (target instanceof ClassProxy)
      {
         ClassProxy proxy = (ClassProxy) target;
         return proxy._dynamicInvoke(invocation);
      }
      else if (target instanceof Proxy)
      {
         Proxy proxy = (Proxy) target;
         return proxy._dynamicInvoke(invocation);
      }
      else if (target instanceof Advised)
      {
         Advisor advisor = ((Advised) target)._getAdvisor();
         return advisor.dynamicInvoke(target, invocation);
View Full Code Here


    * Registers this Container with Remoting / AOP Dispatcher
    */
   protected void registerWithAopDispatcher()
   {
      String registrationName = this.getObjectName().getCanonicalName();
      ClassProxy classProxy = new InvokableContextClassProxyHack(this);
     
      // So that Remoting layer can reference this container easily.
      Dispatcher.singleton.registerTarget(registrationName, classProxy);
     
      // Log
View Full Code Here

    * Registers this Container with Remoting / AOP Dispatcher
    */
   protected void registerWithAopDispatcher()
   {
      String registrationName = this.getObjectName().getCanonicalName();
      ClassProxy classProxy = new InvokableContextClassProxyHack(this);
     
      // So that Remoting layer can reference this container easily.
      Dispatcher.singleton.registerTarget(registrationName, classProxy);
     
      // Log
View Full Code Here

    * Registers this Container with Remoting / AOP Dispatcher
    */
   protected void registerWithAopDispatcher()
   {
      String registrationName = this.getObjectName().getCanonicalName();
      ClassProxy classProxy = new InvokableContextClassProxyHack(this);
     
      // So that Remoting layer can reference this container easily.
      Dispatcher.singleton.registerTarget(registrationName, classProxy);
     
      // Log
View Full Code Here

         Dispatcher.singleton.registerTarget(objectId, obj);
      }
      else
      {
         clazz = obj.getClass();
         ClassProxy proxy = ClassProxyFactory.newInstance(obj.getClass());
         advisor = proxy._getInstanceAdvisor();
         advisor.insertInterceptor(new ForwardingInterceptor(obj));
         Dispatcher.singleton.registerTarget(objectId, proxy);
      }
      families = (Map) advisor.getMetaData().getMetaData(CLUSTERED_REMOTING, CLUSTER_FAMILIES);
      if (families != null)
      {
         target = (HATarget) families.get(proxyFamilyName);
         if (target == null)
         {
            target = new HATarget(partition, proxyFamilyName, locator, HATarget.ENABLE_INVOCATIONS);
            ClusteringTargetsRepository.initTarget(proxyFamilyName, target.getReplicants());
            families.put(proxyFamilyName, target);
         }
      }
      else
      {
         families = new HashMap();
         target = new HATarget(partition, proxyFamilyName, locator, HATarget.ENABLE_INVOCATIONS);
         ClusteringTargetsRepository.initTarget(proxyFamilyName, target.getReplicants());
         families.put(proxyFamilyName, target);
         advisor.insertInterceptor(0, new ReplicantsManagerInterceptor(families));
      }

      ClassProxy proxy = ClassProxyFactory.newInstance(clazz);
      InstanceAdvisor proxyAdvisor = proxy._getInstanceAdvisor();
      proxyAdvisor.insertInterceptor(IsLocalInterceptor.singleton);
      advisor.insertInterceptor(SecurityClientInterceptor.singleton);
      advisor.insertInterceptor(ClientTxPropagationInterceptor.singleton);
      proxyAdvisor.insertInterceptor(MergeMetaDataInterceptor.singleton);
      proxyAdvisor.insertInterceptor(ClusterChooserInterceptor.singleton);
View Full Code Here

   public static void unregisterClusteredObject(Object object)
   {
      try
      {
         ClassProxy proxy = (ClassProxy) object;
         InstanceAdvisor advisor = proxy._getInstanceAdvisor();

         String oid = (String) advisor.getMetaData().getMetaData(Dispatcher.DISPATCHER, Dispatcher.OID);
         InstanceAdvised registeredObject = (InstanceAdvised) Dispatcher.singleton.getRegistered(oid);
         if (registeredObject == null) throw new NotRegisteredException(oid.toString() + " is not registered");
         Dispatcher.singleton.unregisterTarget(oid);
View Full Code Here

    * This is used by DistributedState.buildObject when the DistributedState object is
    * serialized across the wire and must recreate the object it represents
    */
   public ClassProxy addListVersioning(List list, DistributedListState manager) throws Exception
   {
      ClassProxy proxy = ClassProxyFactory.newInstance(list.getClass());
      GUID guid = manager.getGUID();
      org.jboss.aop.metadata.SimpleMetaData metaData = proxy._getInstanceAdvisor().getMetaData();
      metaData.addMetaData(VERSION_MANAGER, VERSION_ID, guid);
      StateManager.setStateManager(proxy, manager);
      CollectionStateChangeInterceptor interceptor = new CollectionStateChangeInterceptor(manager);
      proxy._getInstanceAdvisor().appendInterceptor(interceptor);
      return proxy;
   }
View Full Code Here

    * This is used by DistributedState.buildObject when the DistributedState object is
    * serialized across the wire and must recreate the object it represents
    */
   public ClassProxy addMapVersioning(Map map, DistributedMapState manager) throws Exception
   {
      ClassProxy proxy = ClassProxyFactory.newInstance(map.getClass());
      GUID guid = manager.getGUID();
      org.jboss.aop.metadata.SimpleMetaData metaData = proxy._getInstanceAdvisor().getMetaData();
      metaData.addMetaData(VERSION_MANAGER, VERSION_ID, guid);
      StateManager.setStateManager(proxy, manager);
      CollectionStateChangeInterceptor interceptor = new CollectionStateChangeInterceptor(manager);
      proxy._getInstanceAdvisor().appendInterceptor(interceptor);
      return proxy;
   }
View Full Code Here

    * This is used by DistributedState.buildObject when the DistributedState object is
    * serialized across the wire and must recreate the object it represents
    */
   public ClassProxy addSetVersioning(Set set, DistributedSetState manager) throws Exception
   {
      ClassProxy proxy = ClassProxyFactory.newInstance(set.getClass());
      GUID guid = manager.getGUID();
      org.jboss.aop.metadata.SimpleMetaData metaData = proxy._getInstanceAdvisor().getMetaData();
      metaData.addMetaData(VERSION_MANAGER, VERSION_ID, guid);
      StateManager.setStateManager(proxy, manager);
      CollectionStateChangeInterceptor interceptor = new CollectionStateChangeInterceptor(manager);
      proxy._getInstanceAdvisor().appendInterceptor(interceptor);
      return proxy;
   }
View Full Code Here

   public static Object makeVersioned(Object target)
      throws Exception
   {
      if (target instanceof ClassProxy) throw new IllegalStateException("A ClassProxy is not allowed to be Versioned.  You must have a concrete object");
      ClassProxy proxy = ClassProxyFactory.newInstance(target.getClass());
      VersionedObject versioned = new VersionedObject(target);
      proxy._getInstanceAdvisor().getMetaData().addMetaData(VERSIONED, VERSIONED_OBJECT, versioned, PayloadKey.TRANSIENT);
      proxy._getInstanceAdvisor().appendInterceptor(VersionedObjectInterceptorFactory.getInstance());
      proxy._getInstanceAdvisor().appendInterceptor(new VersionedObjectForwardingInterceptor());
      return proxy;
   }
View Full Code Here

TOP

Related Classes of org.jboss.aop.proxy.ClassProxy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.