org.glassfish.persistence.jpaconnector
Class JPASniffer

java.lang.Object
  extended by org.glassfish.internal.deployment.GenericSniffer
      extended by org.glassfish.persistence.jpaconnector.JPASniffer
All Implemented Interfaces:
SecondarySniffer, Sniffer
Direct Known Subclasses:
JPACompositeSniffer

@Service(name="jpa")
@Scoped(value=org.jvnet.hk2.component.Singleton.class)
public class JPASniffer
extends GenericSniffer
implements SecondarySniffer

Implementation of the Sniffer for JPA.

Author:
Mitesh Meswani

Field Summary
 
Fields inherited from class org.glassfish.internal.deployment.GenericSniffer
modulesRegistry
 
Constructor Summary
JPASniffer()
           
 
Method Summary
 String[] getContainersNames()
           
 boolean handles(ReadableArchive location, ClassLoader loader)
          Returns true if the archive contains persistence.xml as defined by packaging rules of JPA Tries to getResource("META-INF/persitsence.xml") on current classLoader.
protected  boolean scanForPURootsInLibDir(ReadableArchive parentArchive, String libLocation)
           
 
Methods inherited from class org.glassfish.internal.deployment.GenericSniffer
equals, getAnnotationTypes, getContainerModuleNames, getDeploymentConfigurationPaths, getDeploymentConfigurations, getIncompatibleSnifferTypes, getModuleType, getURLPatterns, hashCode, isUserVisible, setup, tearDown
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JPASniffer

public JPASniffer()
Method Detail

handles

public boolean handles(ReadableArchive location,
                       ClassLoader loader)
Returns true if the archive contains persistence.xml as defined by packaging rules of JPA Tries to getResource("META-INF/persitsence.xml") on current classLoader. If it succeeds, current archive is a pu root. This method will be called for each bundle inside an application which would include .war (the resource can be present in WEB-INF/classes or WEB-INF/lib/pu.jar), ejb.jar (the resource can be present in root of the jar),

Specified by:
handles in interface Sniffer
Overrides:
handles in class GenericSniffer

scanForPURootsInLibDir

protected boolean scanForPURootsInLibDir(ReadableArchive parentArchive,
                                         String libLocation)

getContainersNames

public String[] getContainersNames()
Specified by:
getContainersNames in interface Sniffer


Copyright © 2012. All Rights Reserved.