flex-messaging-remoting-1.0

16:35:52.644 INFO  jd.cli.Main - Decompiling flex-messaging-remoting-1.0.jar
package flex.management.runtime.messaging.services;

import flex.management.BaseControl;
import flex.messaging.services.RemotingService;

public class RemotingServiceControl
  extends ServiceControl
  implements RemotingServiceControlMBean
{
  private static final String TYPE = "RemotingService";
  
  public RemotingServiceControl(RemotingService service, BaseControl parent)
  {
    super(service, parent);
  }
  
  public String getType()
  {
    return "RemotingService";
  }
}

/* Location:
 * Qualified Name:     flex.management.runtime.messaging.services.RemotingServiceControl
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package flex.management.runtime.messaging.services;

public abstract interface RemotingServiceControlMBean
  extends ServiceControlMBean
{}

/* Location:
 * Qualified Name:     flex.management.runtime.messaging.services.RemotingServiceControlMBean
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package flex.management.runtime.messaging.services.remoting;

import flex.management.BaseControl;
import flex.management.runtime.AdminConsoleDisplayRegistrar;
import flex.management.runtime.messaging.DestinationControl;
import flex.messaging.services.remoting.RemotingDestination;
import java.io.IOException;
import javax.management.ObjectName;

public class RemotingDestinationControl
  extends DestinationControl
  implements RemotingDestinationControlMBean
{
  private static final String TYPE = "RemotingDestination";
  
  public RemotingDestinationControl(RemotingDestination destination, BaseControl parent)
  {
    super(destination, parent);
  }
  
  private int invocationSuccessCount = 0;
  private int invocationFaultCount = 0;
  private int totalProcessingTimeMillis = 0;
  private int averageProcessingTimeMillis = 0;
  
  public String getType()
  {
    return "RemotingDestination";
  }
  
  public Integer getInvocationSuccessCount()
    throws IOException
  {
    return Integer.valueOf(invocationSuccessCount);
  }
  
  public void incrementInvocationSuccessCount(int processingTimeMillis)
  {
    try
    {
      invocationSuccessCount += 1;
      totalProcessingTimeMillis += processingTimeMillis;
      averageProcessingTimeMillis = (totalProcessingTimeMillis / (invocationSuccessCount + invocationFaultCount));
    }
    catch (Exception needsReset)
    {
      reset();
    }
  }
  
  public Integer getInvocationFaultCount()
    throws IOException
  {
    return Integer.valueOf(invocationFaultCount);
  }
  
  public void incrementInvocationFaultCount(int processingTimeMillis)
  {
    try
    {
      invocationFaultCount += 1;
      totalProcessingTimeMillis += processingTimeMillis;
      averageProcessingTimeMillis = (totalProcessingTimeMillis / (invocationSuccessCount + invocationFaultCount));
    }
    catch (Exception needsReset)
    {
      reset();
    }
  }
  
  public Integer getAverageInvocationProcessingTimeMillis()
    throws IOException
  {
    return Integer.valueOf(averageProcessingTimeMillis);
  }
  
  protected void onRegistrationComplete()
  {
    String name = getObjectName().getCanonicalName();
    
    String[] pollablePerInterval = { "InvocationSuccessCount", "InvocationFaultCount", "AverageInvocationProcessingTimeMillis" };
    
    getRegistrar().registerObjects(new int[] { 151, 50 }, name, pollablePerInterval);
  }
  
  private void reset()
  {
    invocationSuccessCount = 0;
    invocationFaultCount = 0;
    totalProcessingTimeMillis = 0;
    averageProcessingTimeMillis = 0;
  }
}

/* Location:
 * Qualified Name:     flex.management.runtime.messaging.services.remoting.RemotingDestinationControl
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package flex.management.runtime.messaging.services.remoting;

import flex.management.runtime.messaging.DestinationControlMBean;
import java.io.IOException;

public abstract interface RemotingDestinationControlMBean
  extends DestinationControlMBean
{
  public abstract Integer getInvocationSuccessCount()
    throws IOException;
  
  public abstract Integer getInvocationFaultCount()
    throws IOException;
  
  public abstract Integer getAverageInvocationProcessingTimeMillis()
    throws IOException;
}

/* Location:
 * Qualified Name:     flex.management.runtime.messaging.services.remoting.RemotingDestinationControlMBean
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package flex.management.runtime.messaging.services.remoting.adapters;

import flex.management.BaseControl;
import flex.management.runtime.messaging.services.ServiceAdapterControl;
import flex.messaging.services.remoting.adapters.JavaAdapter;

public class JavaAdapterControl
  extends ServiceAdapterControl
  implements JavaAdapterControlMBean
{
  private static final String TYPE = "JavaAdapter";
  
  public JavaAdapterControl(JavaAdapter serviceAdapter, BaseControl parent)
  {
    super(serviceAdapter, parent);
  }
  
  public String getType()
  {
    return "JavaAdapter";
  }
}

/* Location:
 * Qualified Name:     flex.management.runtime.messaging.services.remoting.adapters.JavaAdapterControl
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package flex.management.runtime.messaging.services.remoting.adapters;

import flex.management.runtime.messaging.services.ServiceAdapterControlMBean;

public abstract interface JavaAdapterControlMBean
  extends ServiceAdapterControlMBean
{}

/* Location:
 * Qualified Name:     flex.management.runtime.messaging.services.remoting.adapters.JavaAdapterControlMBean
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package flex.messaging.services;

import flex.management.runtime.messaging.services.RemotingServiceControl;
import flex.management.runtime.messaging.services.remoting.RemotingDestinationControl;
import flex.messaging.Destination;
import flex.messaging.MessageBroker;
import flex.messaging.MessageException;
import flex.messaging.log.Log;
import flex.messaging.log.Logger;
import flex.messaging.messages.Message;
import flex.messaging.messages.MessagePerformanceUtils;
import flex.messaging.messages.RemotingMessage;
import flex.messaging.services.remoting.RemotingDestination;
import flex.messaging.util.MethodMatcher;

public class RemotingService
  extends AbstractService
{
  public static final String LOG_CATEGORY = "Service.Remoting";
  private static final int UNKNOWN_DESTINATION = 10650;
  private MethodMatcher methodMatcher;
  private RemotingServiceControl controller;
  
  public RemotingService()
  {
    this(false);
  }
  
  public RemotingService(boolean enableManagement)
  {
    super(enableManagement);
  }
  
  public Destination createDestination(String id)
  {
    RemotingDestination destination = new RemotingDestination();
    destination.setId(id);
    destination.setManaged(isManaged());
    destination.setService(this);
    
    return destination;
  }
  
  public void addDestination(Destination destination)
  {
    RemotingDestination remotingDest = (RemotingDestination)destination;
    super.addDestination(remotingDest);
  }
  
  public MethodMatcher getMethodMatcher()
  {
    if (methodMatcher == null) {
      methodMatcher = new MethodMatcher();
    }
    return methodMatcher;
  }
  
  public Object serviceMessage(Message msg)
  {
    if ((msg instanceof RemotingMessage))
    {
      RemotingMessage message = (RemotingMessage)msg;
      RemotingDestination destination = (RemotingDestination)getDestination(msg);
      RemotingDestinationControl destinationControl = destination.isManaged() ? (RemotingDestinationControl)destination.getControl() : null;
      if (destination != null)
      {
        ServiceAdapter adapter = destination.getAdapter();
        long startTime = 0L;
        if (destinationControl != null) {
          startTime = System.currentTimeMillis();
        }
        try
        {
          MessagePerformanceUtils.markServerPreAdapterTime(message);
          Object result = adapter.invoke(message);
          MessagePerformanceUtils.markServerPostAdapterTime(message);
          if (Log.isDebug())
          {
            Log.getLogger("Service.Remoting").debug("Adapter '{0}' called '{1}.{2}({3})'", new Object[] { adapter.getId(), message.getSource(), message.getOperation(), message.getParameters() });
            
            Log.getLogger("Service.Remoting").debug("Result: '{0}'", new Object[] { result });
          }
          if (destinationControl != null) {
            destinationControl.incrementInvocationSuccessCount((int)(System.currentTimeMillis() - startTime));
          }
          return result;
        }
        catch (MessageException ex)
        {
          if (destinationControl != null) {
            destinationControl.incrementInvocationFaultCount((int)(System.currentTimeMillis() - startTime));
          }
          throw ex;
        }
        catch (Throwable t)
        {
          if (destinationControl != null) {
            destinationControl.incrementInvocationFaultCount((int)(System.currentTimeMillis() - startTime));
          }
          throw new MessageException(t);
        }
      }
      ServiceException e = new ServiceException();
      e.setMessage(10650, new Object[] { msg.getDestination() });
      throw e;
    }
    ServiceException e = new ServiceException();
    e.setMessage(10454, new Object[] { "Remoting", "RemotingMessage" });
    throw e;
  }
  
  protected String getLogCategory()
  {
    return "Service.Remoting";
  }
  
  protected void setupServiceControl(MessageBroker broker)
  {
    controller = new RemotingServiceControl(this, broker.getControl());
    controller.register();
    setControl(controller);
  }
}

/* Location:
 * Qualified Name:     flex.messaging.services.RemotingService
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package flex.messaging.services.remoting;

import flex.messaging.FlexContext;
import flex.messaging.FlexSession;
import flex.messaging.io.PageableRowSet;
import flex.messaging.io.PagedRowSet;
import java.sql.SQLException;
import java.util.Map;
import javax.sql.RowSet;

public class PageableRowSetCache
{
  private static final int DEFAULT_PAGE_SIZE = 25;
  
  public static PageableRowSet cacheRowSet(RowSet rowset, int pageSize)
  {
    if (pageSize <= 0) {
      pageSize = 25;
    }
    PageableRowSet prs = new PagedRowSet(rowset, pageSize, true);
    cachePageableRowSet(prs);
    return prs;
  }
  
  public static void cachePageableRowSet(PageableRowSet rowset)
  {
    if (rowset != null)
    {
      FlexSession session = FlexContext.getFlexSession();
      session.setAttribute(rowset.getID(), rowset);
    }
  }
  
  public Map getRecords(String id, int startIndex, int count)
    throws SQLException
  {
    Map page = null;
    FlexSession session = FlexContext.getFlexSession();
    if (session != null)
    {
      Object o = session.getAttribute(id);
      if ((o != null) && ((o instanceof PageableRowSet)))
      {
        PageableRowSet rs = (PageableRowSet)o;
        page = rs.getRecords(startIndex, count);
      }
    }
    return page;
  }
  
  public void release(String id)
  {
    FlexSession session = FlexContext.getFlexSession();
    if (session != null) {
      session.removeAttribute(id);
    }
  }
}

/* Location:
 * Qualified Name:     flex.messaging.services.remoting.PageableRowSetCache
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package flex.messaging.services.remoting;

import flex.management.runtime.messaging.services.remoting.RemotingDestinationControl;
import flex.messaging.FactoryDestination;
import flex.messaging.MessageBroker;
import flex.messaging.MessageException;
import flex.messaging.services.RemotingService;
import flex.messaging.services.Service;
import flex.messaging.util.MethodMatcher;

public class RemotingDestination
  extends FactoryDestination
{
  static final long serialVersionUID = -8454338922948146048L;
  public static final String LOG_CATEGORY = "Service.Remoting";
  private static final String REMOTING_SERVICE_CLASS = "flex.messaging.services.RemotingService";
  public static final int NO_MESSAGE_BROKER = 10163;
  private static final int NO_REMOTING_SERVICE = 10657;
  private MethodMatcher methodMatcher;
  private RemotingDestinationControl controller;
  
  public RemotingDestination()
  {
    this(false);
  }
  
  public RemotingDestination(boolean enableManagement)
  {
    super(enableManagement);
  }
  
  public static RemotingDestination getRemotingDestination(String serverId, String destinationName)
  {
    MessageBroker broker = MessageBroker.getMessageBroker(serverId);
    if (broker == null)
    {
      MessageException me = new MessageException();
      me.setMessage(10163, new Object[] { serverId });
      throw me;
    }
    RemotingService rs = (RemotingService)broker.getServiceByType("flex.messaging.services.RemotingService");
    if (rs == null)
    {
      MessageException me = new MessageException();
      me.setMessage(10657, new Object[] { serverId });
      throw me;
    }
    return (RemotingDestination)rs.getDestination(destinationName);
  }
  
  public String getLogCategory()
  {
    return "Service.Remoting";
  }
  
  public void setService(Service service)
  {
    RemotingService remotingService = (RemotingService)service;
    super.setService(remotingService);
    setMethodMatcher(remotingService.getMethodMatcher());
  }
  
  public MethodMatcher getMethodMatcher()
  {
    return methodMatcher;
  }
  
  public void setMethodMatcher(MethodMatcher matcher)
  {
    methodMatcher = matcher;
  }
  
  protected void setupDestinationControl(Service service)
  {
    controller = new RemotingDestinationControl(this, service.getControl());
    controller.register();
    setControl(controller);
  }
}

/* Location:
 * Qualified Name:     flex.messaging.services.remoting.RemotingDestination
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package flex.messaging.services.remoting.adapters;

import flex.management.runtime.messaging.services.remoting.adapters.JavaAdapterControl;
import flex.messaging.Destination;
import flex.messaging.FactoryInstance;
import flex.messaging.FlexComponent;
import flex.messaging.MessageBroker;
import flex.messaging.MessageException;
import flex.messaging.config.ConfigMap;
import flex.messaging.config.ConfigurationException;
import flex.messaging.config.SecurityConstraint;
import flex.messaging.log.Log;
import flex.messaging.log.Logger;
import flex.messaging.messages.Message;
import flex.messaging.messages.RemotingMessage;
import flex.messaging.security.LoginManager;
import flex.messaging.security.SecurityException;
import flex.messaging.services.Service;
import flex.messaging.services.ServiceAdapter;
import flex.messaging.services.remoting.RemotingDestination;
import flex.messaging.util.ExceptionUtil;
import flex.messaging.util.MethodMatcher;
import flex.messaging.util.MethodMatcher.Match;
import flex.messaging.util.StringUtils;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.security.AccessController;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

public class JavaAdapter
  extends ServiceAdapter
{
  static final String LOG_CATEGORY = "Message.Remoting";
  public static final String[] PROTECTED_PACKAGES = { "jrun", "jrunx", "macromedia", "flex", "flex2", "coldfusion", "allaire", "com.allaire", "com.macromedia" };
  private static final int REMOTING_METHOD_NULL_NAME_ERRMSG = 10658;
  private static final int REMOTING_METHOD_REFS_UNDEFINED_CONSTRAINT_ERRMSG = 10659;
  private static final int REMOTING_METHOD_NOT_DEFINED_ERRMSG = 10660;
  private static final String PROPERTY_INCLUDE_METHODS = "include-methods";
  private static final String PROPERTY_EXCLUDE_METHODS = "exclude-methods";
  private static final String METHOD_ELEMENT = "method";
  private static final String NAME_ELEMENT = "name";
  private JavaAdapterControl controller;
  private Map excludeMethods;
  private Map includeMethods;
  
  public JavaAdapter()
  {
    this(false);
  }
  
  public JavaAdapter(boolean enableManagement)
  {
    super(enableManagement);
  }
  
  public void setDestination(Destination destination)
  {
    Destination dest = (RemotingDestination)destination;
    super.setDestination(dest);
  }
  
  public Iterator getExcludeMethodIterator()
  {
    if (excludeMethods == null) {
      return Collections.EMPTY_LIST.iterator();
    }
    return excludeMethods.values().iterator();
  }
  
  public void addExcludeMethod(RemotingMethod value)
  {
    String name = value.getName();
    if (name == null)
    {
      ConfigurationException ce = new ConfigurationException();
      ce.setMessage(10658, new Object[] { getDestination().getId() });
      throw ce;
    }
    if (!isMethodDefinedBySource(name))
    {
      ConfigurationException ce = new ConfigurationException();
      ce.setMessage(10660, new Object[] { name, getDestination().getId() });
      throw ce;
    }
    if (excludeMethods == null)
    {
      excludeMethods = new HashMap();
      excludeMethods.put(name, value);
    }
    else if (!excludeMethods.containsKey(name))
    {
      excludeMethods.put(name, value);
    }
  }
  
  public void removeExcludeMethod(RemotingMethod value)
  {
    excludeMethods.remove(value.getName());
  }
  
  public Iterator getIncludeMethodIterator()
  {
    if (includeMethods == null) {
      return Collections.EMPTY_LIST.iterator();
    }
    return includeMethods.values().iterator();
  }
  
  public void addIncludeMethod(RemotingMethod value)
  {
    String name = value.getName();
    if (name == null)
    {
      ConfigurationException ce = new ConfigurationException();
      ce.setMessage(10658, new Object[] { getDestination().getId() });
      throw ce;
    }
    if (!isMethodDefinedBySource(name))
    {
      ConfigurationException ce = new ConfigurationException();
      ce.setMessage(10660, new Object[] { name, getDestination().getId() });
      throw ce;
    }
    if (includeMethods == null)
    {
      includeMethods = new HashMap();
      includeMethods.put(name, value);
    }
    else if (!includeMethods.containsKey(name))
    {
      includeMethods.put(name, value);
    }
  }
  
  public void removeIncludeMethod(RemotingMethod value)
  {
    includeMethods.remove(value.getName());
  }
  
  public void initialize(String id, ConfigMap properties)
  {
    ConfigMap methodsToInclude = properties.getPropertyAsMap("include-methods", null);
    if (methodsToInclude != null)
    {
      List methods = methodsToInclude.getPropertyAsList("method", null);
      if ((methods != null) && (!methods.isEmpty()))
      {
        int n = methods.size();
        for (int i = 0; i < n; i++)
        {
          ConfigMap methodSettings = (ConfigMap)methods.get(i);
          String name = methodSettings.getPropertyAsString("name", null);
          RemotingMethod method = new RemotingMethod();
          method.setName(name);
          
          String constraintRef = methodSettings.getPropertyAsString("security-constraint", null);
          if (constraintRef != null) {
            try
            {
              method.setSecurityConstraint(getDestination().getService().getMessageBroker().getSecurityConstraint(constraintRef));
            }
            catch (SecurityException se)
            {
              ConfigurationException ce = new ConfigurationException();
              ce.setMessage(10659, new Object[] { name, getDestination().getId(), constraintRef });
              throw ce;
            }
          }
          addIncludeMethod(method);
        }
      }
    }
    ConfigMap methodsToExclude = properties.getPropertyAsMap("exclude-methods", null);
    if (methodsToExclude != null)
    {
      if (includeMethods != null)
      {
        RemotingDestination dest = (RemotingDestination)getDestination();
        if (Log.isWarn()) {
          Log.getLogger("Configuration").warn("The remoting destination '" + dest.getId() + "' contains both <include-methods/> and <exclude-methods/> configuration. The <exclude-methods/> block will be ignored.");
        }
      }
      List methods = methodsToExclude.getPropertyAsList("method", null);
      if ((methods != null) && (!methods.isEmpty()))
      {
        int n = methods.size();
        for (int i = 0; i < n; i++)
        {
          ConfigMap methodSettings = (ConfigMap)methods.get(i);
          String name = methodSettings.getPropertyAsString("name", null);
          RemotingMethod method = new RemotingMethod();
          method.setName(name);
          
          String constraintRef = methodSettings.getPropertyAsString("security-constraint", null);
          if (includeMethods == null)
          {
            if (constraintRef != null)
            {
              RemotingDestination dest = (RemotingDestination)getDestination();
              if (Log.isWarn()) {
                Log.getLogger("Configuration").warn("The method '" + name + "' for remoting destination '" + dest.getId() + "' is configured to use a security constraint, but security constraints are not applicable for excluded methods.");
              }
            }
            addExcludeMethod(method);
          }
        }
      }
    }
  }
  
  public void start()
  {
    if (isStarted()) {
      return;
    }
    super.start();
    validateInstanceSettings();
    
    RemotingDestination remotingDestination = (RemotingDestination)getDestination();
    if ("application".equals(remotingDestination.getScope()))
    {
      FactoryInstance factoryInstance = remotingDestination.getFactoryInstance();
      createInstance(factoryInstance.getInstanceClass());
    }
  }
  
  public Object invoke(Message message)
  {
    RemotingDestination remotingDestination = (RemotingDestination)getDestination();
    RemotingMessage remotingMessage = (RemotingMessage)message;
    FactoryInstance factoryInstance = remotingDestination.getFactoryInstance();
    
    String className = factoryInstance.getSource();
    remotingMessage.setSource(className);
    
    String methodName = remotingMessage.getOperation();
    List parameters = remotingMessage.getParameters();
    Object result = null;
    try
    {
      if (includeMethods != null)
      {
        RemotingMethod method = (RemotingMethod)includeMethods.get(methodName);
        if (method == null) {
          MethodMatcher.methodNotFound(methodName, null, new MethodMatcher.Match(null));
        }
        SecurityConstraint constraint = method.getSecurityConstraint();
        if (constraint != null) {
          getDestination().getService().getMessageBroker().getLoginManager().checkConstraint(constraint);
        }
      }
      else if ((excludeMethods != null) && (excludeMethods.containsKey(methodName)))
      {
        MethodMatcher.methodNotFound(methodName, null, new MethodMatcher.Match(null));
      }
      Object instance = createInstance(factoryInstance.getInstanceClass());
      if (instance == null)
      {
        MessageException me = new MessageException("Null instance returned from: " + factoryInstance);
        me.setCode("Server.Processing");
        throw me;
      }
      Class c = instance.getClass();
      
      MethodMatcher methodMatcher = remotingDestination.getMethodMatcher();
      Method method = methodMatcher.getMethod(c, methodName, parameters);
      result = method.invoke(instance, parameters.toArray());
      
      saveInstance(instance);
    }
    catch (InvocationTargetException ex)
    {
      Throwable cause = ex.getCause();
      if ((cause != null) && ((cause instanceof MessageException))) {
        throw ((MessageException)cause);
      }
      if (cause != null)
      {
        if (Log.isError()) {
          Log.getLogger("Message.Remoting").error("Error processing remote invocation: " + cause.toString() + StringUtils.NEWLINE + "  incomingMessage: " + message + StringUtils.NEWLINE + ExceptionUtil.toString(cause));
        }
        MessageException me = new MessageException(cause.getClass().getName() + " : " + cause.getMessage());
        me.setCode("Server.Processing");
        me.setRootCause(cause);
        throw me;
      }
      MessageException me = new MessageException(ex.getMessage());
      me.setCode("Server.Processing");
      throw me;
    }
    catch (IllegalAccessException ex)
    {
      MessageException me = new MessageException(ex.getMessage());
      me.setCode("Server.Processing");
      throw me;
    }
    return result;
  }
  
  protected Object createInstance(Class cl)
  {
    RemotingDestination remotingDestination = (RemotingDestination)getDestination();
    
    FactoryInstance factoryInstance = remotingDestination.getFactoryInstance();
    Object instance = factoryInstance.lookup();
    if ((isStarted()) && ((instance instanceof FlexComponent)) && (!((FlexComponent)instance).isStarted())) {
      ((FlexComponent)instance).start();
    }
    return instance;
  }
  
  protected void saveInstance(Object instance)
  {
    RemotingDestination remotingDestination = (RemotingDestination)getDestination();
    FactoryInstance factoryInstance = remotingDestination.getFactoryInstance();
    factoryInstance.operationComplete(instance);
  }
  
  protected void assertAccess(String serviceClass)
  {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null)
    {
      if (serviceClass.indexOf(".") != -1)
      {
        StringBuffer permissionData = new StringBuffer("accessClassInPackage.");
        permissionData.append(serviceClass.substring(0, serviceClass.lastIndexOf(".")));
        RuntimePermission perm = new RuntimePermission(permissionData.toString());
        AccessController.checkPermission(perm);
      }
    }
    else {
      for (int i = 0; i < PROTECTED_PACKAGES.length; i++) {
        if (serviceClass.startsWith(PROTECTED_PACKAGES[i]))
        {
          StringBuffer permissionData = new StringBuffer("accessClassInPackage.");
          permissionData.append(PROTECTED_PACKAGES[i].substring(0, PROTECTED_PACKAGES[i].length()));
          RuntimePermission perm = new RuntimePermission(permissionData.toString());
          AccessController.checkPermission(perm);
        }
      }
    }
  }
  
  protected void validateInstanceSettings()
  {
    RemotingDestination remotingDestination = (RemotingDestination)getDestination();
    
    remotingDestination.getFactoryInstance();
  }
  
  protected String getLogCategory()
  {
    return "Message.Remoting";
  }
  
  protected void setupAdapterControl(Destination destination)
  {
    controller = new JavaAdapterControl(this, destination.getControl());
    controller.register();
    setControl(controller);
  }
  
  private boolean isMethodDefinedBySource(String methodName)
  {
    RemotingDestination remotingDestination = (RemotingDestination)getDestination();
    FactoryInstance factoryInstance = remotingDestination.getFactoryInstance();
    Class c = factoryInstance.getInstanceClass();
    if (c == null) {
      return true;
    }
    Method[] methods = c.getMethods();
    int n = methods.length;
    for (int i = 0; i < n; i++) {
      if (methods[i].getName().equals(methodName)) {
        return true;
      }
    }
    return false;
  }
}

/* Location:
 * Qualified Name:     flex.messaging.services.remoting.adapters.JavaAdapter
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package flex.messaging.services.remoting.adapters;

import flex.messaging.MessageException;

public class NoSuchMethodException
  extends MessageException
{
  static final long serialVersionUID = -3383405805642648507L;
  
  public NoSuchMethodException(String s)
  {
    setMessage(s);
    setCode("Server.ResourceUnavailable");
  }
}

/* Location:
 * Qualified Name:     flex.messaging.services.remoting.adapters.NoSuchMethodException
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package flex.messaging.services.remoting.adapters;

import flex.messaging.MessageException;

public class NoSuchServiceException
  extends MessageException
{
  static final long serialVersionUID = -8758088739688377326L;
  
  public NoSuchServiceException(String s)
  {
    super(s);
    setCode("Server.ResourceNotFound");
  }
}

/* Location:
 * Qualified Name:     flex.messaging.services.remoting.adapters.NoSuchServiceException
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package flex.messaging.services.remoting.adapters;

import flex.messaging.config.SecurityConstraint;

public class RemotingMethod
{
  private String name;
  private SecurityConstraint constraint;
  
  public String getName()
  {
    return name;
  }
  
  public void setName(String value)
  {
    name = value;
  }
  
  public SecurityConstraint getSecurityConstraint()
  {
    return constraint;
  }
  
  public void setSecurityConstraint(SecurityConstraint value)
  {
    constraint = value;
  }
}

/* Location:
 * Qualified Name:     flex.messaging.services.remoting.adapters.RemotingMethod
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
1

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd