OPENJPA-2030: Loading custom Auditor in OSGi environment

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1176436 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Pinaki Poddar 2011-09-27 15:32:59 +00:00
parent f455e09b4e
commit e65b2aa518
2 changed files with 26 additions and 2 deletions

View File

@ -1867,18 +1867,33 @@ public interface OpenJPAConfiguration
/**
* Gets an instance of {@link AuditManager} associated with this configuration.
* Gets the singular instance of {@link Auditor} associated with this configuration.
*
* @since 2.2.0
*/
public Auditor getAuditorInstance();
/**
* Gets the plug-in string of {@link AuditManager} specified in this configuration.
* Sets the singular instance of {@link Auditor} associated with this configuration.
*
* @since 2.2.0
*/
public void setAuditorInstance(Auditor auditor);
/**
* Gets the plug-in string of {@link Auditor} specified in this configuration.
*
* @since 2.2.0
*/
public String getAuditor();
/**
* Sets the plug-in string of {@link Auditor} specified in this configuration.
*
* @since 2.2.0
*/
public void setAuditor(String s);
}

View File

@ -1660,6 +1660,7 @@ public class OpenJPAConfigurationImpl
super.instantiateAll();
getMetaDataRepositoryInstance();
getRemoteCommitEventManager();
getAuditorInstance();
cacheMarshallerPlugins.initialize();
if (isInitializeEagerly()) {
getConnectionFactory();
@ -1824,8 +1825,16 @@ public class OpenJPAConfigurationImpl
return auditor;
}
public void setAuditorInstance(Auditor auditor) {
auditorPlugin.set(auditor);
}
public String getAuditor() {
return auditorPlugin.getString();
}
public void setAuditor(String auditor) {
auditorPlugin.setString(auditor);
}
}