org.eclipse.equinox.jsp.jasper.registry_1.0.300.v20120912-130548

16:43:58.284 INFO  jd.cli.Main - Decompiling org.eclipse.equinox.jsp.jasper.registry_1.0.300.v20120912-130548.jar
package org.eclipse.equinox.internal.jsp.jasper.registry;

import org.osgi.framework.Bundle;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.packageadmin.PackageAdmin;
import org.osgi.util.tracker.ServiceTracker;
import org.osgi.util.tracker.ServiceTrackerCustomizer;

public class Activator
  implements BundleActivator, ServiceTrackerCustomizer
{
  private ServiceTracker packageAdminTracker;
  private static PackageAdmin packageAdmin;
  private BundleContext context;
  
  public void start(BundleContext context)
    throws Exception
  {
    this.context = context;
    packageAdminTracker = new ServiceTracker(context, PackageAdmin.class.getName(), this);
    packageAdminTracker.open();
  }
  
  public void stop(BundleContext context)
    throws Exception
  {
    packageAdminTracker.close();
    packageAdminTracker = null;
    this.context = null;
  }
  
  public static synchronized Bundle getBundle(String symbolicName)
  {
    if (packageAdmin == null) {
      throw new IllegalStateException("Not started");
    }
    Bundle[] bundles = packageAdmin.getBundles(symbolicName, null);
    if (bundles == null) {
      return null;
    }
    for (int i = 0; i < bundles.length; i++) {
      if ((bundles[i].getState() & 0x3) == 0) {
        return bundles[i];
      }
    }
    return null;
  }
  
  public Object addingService(ServiceReference reference)
  {
    synchronized (Activator.class)
    {
      packageAdmin = (PackageAdmin)context.getService(reference);
    }
    return packageAdmin;
  }
  
  public void modifiedService(ServiceReference reference, Object service) {}
  
  public void removedService(ServiceReference reference, Object service)
  {
    synchronized (Activator.class)
    {
      context.ungetService(reference);
      packageAdmin = null;
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.jsp.jasper.registry.Activator
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.jsp.jasper.registry;

import java.util.Hashtable;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IContributor;
import org.eclipse.core.runtime.IExecutableExtension;
import org.eclipse.core.runtime.IExecutableExtensionFactory;
import org.eclipse.equinox.internal.jsp.jasper.registry.Activator;
import org.eclipse.equinox.jsp.jasper.JspServlet;
import org.osgi.framework.Bundle;

public class JSPFactory
  implements IExecutableExtensionFactory, IExecutableExtension
{
  private IConfigurationElement config;
  private String bundleResourcePath;
  
  public void setInitializationData(IConfigurationElement config, String propertyName, Object data)
    throws CoreException
  {
    this.config = config;
    if (data != null) {
      if ((data instanceof String)) {
        bundleResourcePath = ((String)data);
      } else if ((data instanceof Hashtable)) {
        bundleResourcePath = ((String)((Hashtable)data).get("path"));
      }
    }
  }
  
  public Object create()
    throws CoreException
  {
    Bundle b = Activator.getBundle(config.getContributor().getName());
    String alias = config.getAttribute("alias");
    if ((alias != null) && (alias.indexOf("/*.") == alias.lastIndexOf('/')))
    {
      alias = alias.substring(0, alias.lastIndexOf('/'));
      if (alias.length() == 0) {
        alias = "/";
      }
    }
    return new JspServlet(b, bundleResourcePath, alias);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.jsp.jasper.registry.JSPFactory
 * Java Class Version: 1.1 (45.3)
 * 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