You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by tv...@apache.org on 2013/12/03 01:30:08 UTC
svn commit: r1547247 [1/2] - in
/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb:
assembler/classic/ config/ config/rules/ core/interceptor/ core/ivm/naming/
core/security/ core/timer/ core/transaction/ resource/ util/
Author: tveronezi
Date: Tue Dec 3 00:30:07 2013
New Revision: 1547247
URL: http://svn.apache.org/r1547247
Log:
cosmetic - replacing tabs by four space characters.
Modified:
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/MethodConcurrencyBuilder.java
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ValidatorBuilder.java
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ConnectorModule.java
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/VmDeploymentManager.java
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/WsDeployer.java
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckClasses.java
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/ReflectionInvocationContext.java
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/naming/IvmContext.java
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/security/ConnectorCallbackHandler.java
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/timer/EJBCronTrigger.java
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/timer/SingleActionTimerData.java
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/SimpleBootstrapContext.java
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/resource/GeronimoConnectionManagerFactory.java
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/util/Memoizer.java
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/util/Slf4jLogStream.java
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/util/Slf4jLogStreamFactory.java
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/util/StringTemplate.java
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/MethodConcurrencyBuilder.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/MethodConcurrencyBuilder.java?rev=1547247&r1=1547246&r2=1547247&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/MethodConcurrencyBuilder.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/MethodConcurrencyBuilder.java Tue Dec 3 00:30:07 2013
@@ -85,7 +85,7 @@ public class MethodConcurrencyBuilder {
Method method = entry.getKey();
MethodConcurrencyInfo value = (MethodConcurrencyInfo) entry.getValue();
log.debug("AccessTimeout: " + method + " -- " + MethodInfoUtil.toString(value.methods.get(0)) + " " +
- " " + value.accessTimeout.time + " " + value.accessTimeout.unit);
+ " " + value.accessTimeout.time + " " + value.accessTimeout.unit);
}
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ValidatorBuilder.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ValidatorBuilder.java?rev=1547247&r1=1547246&r2=1547247&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ValidatorBuilder.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ValidatorBuilder.java Tue Dec 3 00:30:07 2013
@@ -91,7 +91,7 @@ public final class ValidatorBuilder {
}
@SuppressWarnings("unchecked")
- private static Configuration<?> getConfig(ValidationInfo info) {
+ private static Configuration<?> getConfig(ValidationInfo info) {
Configuration<?> target = null;
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java?rev=1547247&r1=1547246&r2=1547247&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java Tue Dec 3 00:30:07 2013
@@ -524,325 +524,325 @@ public class AnnotationDeployer implemen
public ConnectorModule deploy(ConnectorModule connectorModule) throws OpenEJBException {
- org.apache.openejb.jee.Connector connector = connectorModule.getConnector();
- if (connector == null) {
- connector = new org.apache.openejb.jee.Connector();
- }
-
- // JCA 1.6 - 18.3.1 do not look at annotations if the provided connector
- // deployment descriptor is "meta-data complete".
-
- float specVersion = 0;
- try {
- specVersion = Float.parseFloat(connector.getVersion());
- } catch (Exception e) {
+ org.apache.openejb.jee.Connector connector = connectorModule.getConnector();
+ if (connector == null) {
+ connector = new org.apache.openejb.jee.Connector();
+ }
+
+ // JCA 1.6 - 18.3.1 do not look at annotations if the provided connector
+ // deployment descriptor is "meta-data complete".
+
+ float specVersion = 0;
+ try {
+ specVersion = Float.parseFloat(connector.getVersion());
+ } catch (Exception e) {
// no-op
- }
+ }
- if (specVersion < 1.6 || Boolean.TRUE.equals(connector.isMetadataComplete())) {
- return connectorModule;
- }
-
-
- IAnnotationFinder finder = connectorModule.getFinder();
- if (finder == null) {
- try {
- finder = FinderFactory.createFinder(connectorModule);
- connectorModule.setFinder(finder);
- } catch (Exception e) {
- // TODO: some sort of error
- return connectorModule;
- }
- }
-
- List<Class<?>> connectorClasses = finder.findAnnotatedClasses(Connector.class);
-
- // are we allowed to have more than one connector class? Not without a deployment descriptor
- if (connector.getResourceAdapter() == null || connector.getResourceAdapter().getResourceAdapterClass() == null || connector.getResourceAdapter().getResourceAdapterClass().length() == 0) {
- if (connectorClasses.size() == 0) { //NOPMD
- // TODO: fail some validation here too
- }
-
- if (connectorClasses.size() > 1) { //NOPMD
- // too many connector classes, this is against the spec
- // TODO: something like connectorModule.getValidation().fail(ejbName, "abstractAnnotatedAsBean", annotationClass.getSimpleName(), beanClass.get().getName());
- }
- }
-
- Class<?> connectorClass = null;
- if (connectorClasses.size() == 1) {
- connectorClass = connectorClasses.get(0);
- }
-
- if (connectorClasses.size() > 1) {
- for (Class<?> cls : connectorClasses) {
- if (cls.getName().equals(connector.getResourceAdapter().getResourceAdapterClass())) {
- connectorClass = cls;
- break;
- }
- }
- }
-
- if (connectorClass != null) {
- if (connector.getResourceAdapter() == null) {
- connector.setResourceAdapter(new ResourceAdapter());
- }
-
- if (connector.getResourceAdapter().getResourceAdapterClass() == null || connector.getResourceAdapter().getResourceAdapterClass().length() == 0) {
- connector.getResourceAdapter().setResourceAdapterClass(connectorClass.getName());
- }
-
- Connector connectorAnnotation = connectorClass.getAnnotation(Connector.class);
-
- connector.setDisplayNames(getTexts(connector.getDisplayNames(), connectorAnnotation.displayName()));
- connector.setDescriptions(getTexts(connector.getDescriptions(), connectorAnnotation.description()));
-
- connector.setEisType(getString(connector.getEisType(), connectorAnnotation.eisType()));
- connector.setVendorName(getString(connector.getVendorName(), connectorAnnotation.vendorName()));
- connector.setResourceAdapterVersion(getString(connector.getResourceAdapterVersion(), connectorAnnotation.version()));
-
- if (connector.getIcons().isEmpty()) {
- int smallIcons = connectorAnnotation.smallIcon().length;
- int largeIcons = connectorAnnotation.largeIcon().length;
+ if (specVersion < 1.6 || Boolean.TRUE.equals(connector.isMetadataComplete())) {
+ return connectorModule;
+ }
+
+
+ IAnnotationFinder finder = connectorModule.getFinder();
+ if (finder == null) {
+ try {
+ finder = FinderFactory.createFinder(connectorModule);
+ connectorModule.setFinder(finder);
+ } catch (Exception e) {
+ // TODO: some sort of error
+ return connectorModule;
+ }
+ }
- for (int i = 0; i < smallIcons && i < largeIcons; i++) {
- Icon icon = new Icon();
+ List<Class<?>> connectorClasses = finder.findAnnotatedClasses(Connector.class);
+
+ // are we allowed to have more than one connector class? Not without a deployment descriptor
+ if (connector.getResourceAdapter() == null || connector.getResourceAdapter().getResourceAdapterClass() == null || connector.getResourceAdapter().getResourceAdapterClass().length() == 0) {
+ if (connectorClasses.size() == 0) { //NOPMD
+ // TODO: fail some validation here too
+ }
+
+ if (connectorClasses.size() > 1) { //NOPMD
+ // too many connector classes, this is against the spec
+ // TODO: something like connectorModule.getValidation().fail(ejbName, "abstractAnnotatedAsBean", annotationClass.getSimpleName(), beanClass.get().getName());
+ }
+ }
+
+ Class<?> connectorClass = null;
+ if (connectorClasses.size() == 1) {
+ connectorClass = connectorClasses.get(0);
+ }
+
+ if (connectorClasses.size() > 1) {
+ for (Class<?> cls : connectorClasses) {
+ if (cls.getName().equals(connector.getResourceAdapter().getResourceAdapterClass())) {
+ connectorClass = cls;
+ break;
+ }
+ }
+ }
+
+ if (connectorClass != null) {
+ if (connector.getResourceAdapter() == null) {
+ connector.setResourceAdapter(new ResourceAdapter());
+ }
+
+ if (connector.getResourceAdapter().getResourceAdapterClass() == null || connector.getResourceAdapter().getResourceAdapterClass().length() == 0) {
+ connector.getResourceAdapter().setResourceAdapterClass(connectorClass.getName());
+ }
+
+ Connector connectorAnnotation = connectorClass.getAnnotation(Connector.class);
+
+ connector.setDisplayNames(getTexts(connector.getDisplayNames(), connectorAnnotation.displayName()));
+ connector.setDescriptions(getTexts(connector.getDescriptions(), connectorAnnotation.description()));
+
+ connector.setEisType(getString(connector.getEisType(), connectorAnnotation.eisType()));
+ connector.setVendorName(getString(connector.getVendorName(), connectorAnnotation.vendorName()));
+ connector.setResourceAdapterVersion(getString(connector.getResourceAdapterVersion(), connectorAnnotation.version()));
+
+ if (connector.getIcons().isEmpty()) {
+ int smallIcons = connectorAnnotation.smallIcon().length;
+ int largeIcons = connectorAnnotation.largeIcon().length;
+
+ for (int i = 0; i < smallIcons && i < largeIcons; i++) {
+ Icon icon = new Icon();
// locale can't be specified in the annotation and it is en by default
// so on other systems it doesn't work because Icon return the default locale
icon.setLang(Locale.getDefault().getLanguage());
- if (i < smallIcons) {
- icon.setSmallIcon(connectorAnnotation.smallIcon()[i]);
- }
-
- if (i < largeIcons) {
- icon.setLargeIcon(connectorAnnotation.largeIcon()[i]);
- }
-
- connector.getIcons().add(icon);
- }
- }
-
- if (connector.getLicense() == null) {
- License license = new License();
- connector.setLicense(license);
- license.setLicenseRequired(connectorAnnotation.licenseRequired());
- }
-
- connector.getLicense().setDescriptions(getTexts(connector.getLicense().getDescriptions(), connectorAnnotation.licenseDescription()));
-
-
- SecurityPermission[] annotationSecurityPermissions = connectorAnnotation.securityPermissions();
- List<org.apache.openejb.jee.SecurityPermission> securityPermission = connector.getResourceAdapter().getSecurityPermission();
- if (securityPermission == null || securityPermission.size() == 0) {
- for (SecurityPermission sp : annotationSecurityPermissions) {
- org.apache.openejb.jee.SecurityPermission permission = new org.apache.openejb.jee.SecurityPermission();
- permission.setSecurityPermissionSpec(sp.permissionSpec());
- permission.setDescriptions(stringsToTexts(sp.description()));
- securityPermission.add(permission);
- }
- }
-
- Class<? extends WorkContext>[] annotationRequiredWorkContexts = connectorAnnotation.requiredWorkContexts();
- List<String> requiredWorkContext = connector.getRequiredWorkContext();
- if (requiredWorkContext.size() == 0) {
- for (Class<? extends WorkContext> cls : annotationRequiredWorkContexts) {
- requiredWorkContext.add(cls.getName());
- }
- }
-
- OutboundResourceAdapter outboundResourceAdapter = connector.getResourceAdapter().getOutboundResourceAdapter();
- if (outboundResourceAdapter == null) {
- outboundResourceAdapter = new OutboundResourceAdapter();
- connector.getResourceAdapter().setOutboundResourceAdapter(outboundResourceAdapter);
- }
-
- List<AuthenticationMechanism> authenticationMechanisms = outboundResourceAdapter.getAuthenticationMechanism();
- javax.resource.spi.AuthenticationMechanism[] authMechanisms = connectorAnnotation.authMechanisms();
- if (authenticationMechanisms.size() == 0) {
- for (javax.resource.spi.AuthenticationMechanism am : authMechanisms) {
- AuthenticationMechanism authMechanism = new AuthenticationMechanism();
- authMechanism.setAuthenticationMechanismType(am.authMechanism());
- authMechanism.setCredentialInterface(am.credentialInterface().toString());
- authMechanism.setDescriptions(stringsToTexts(am.description()));
-
- authenticationMechanisms.add(authMechanism);
- }
- }
-
- if (outboundResourceAdapter.getTransactionSupport() == null) {
- outboundResourceAdapter.setTransactionSupport(TransactionSupportType.fromValue(connectorAnnotation.transactionSupport().toString()));
- }
-
- if (outboundResourceAdapter.isReauthenticationSupport() == null) {
- outboundResourceAdapter.setReauthenticationSupport(connectorAnnotation.reauthenticationSupport());
- }
- }
-
- // process @ConnectionDescription(s)
- List<Class<?>> classes = finder.findAnnotatedClasses(ConnectionDefinitions.class);
- for (Class<?> cls : classes) {
- ConnectionDefinitions connectionDefinitionsAnnotation = cls.getAnnotation(ConnectionDefinitions.class);
- ConnectionDefinition[] definitions = connectionDefinitionsAnnotation.value();
-
- for (ConnectionDefinition definition : definitions) {
- processConnectionDescription(connector.getResourceAdapter(), definition, cls);
- }
- }
-
- classes = finder.findAnnotatedClasses(ConnectionDefinition.class);
- for (Class<?> cls : classes) {
- ConnectionDefinition connectionDefinitionAnnotation = cls.getAnnotation(ConnectionDefinition.class);
- processConnectionDescription(connector.getResourceAdapter(), connectionDefinitionAnnotation, cls);
- }
-
-
- InboundResourceadapter inboundResourceAdapter = connector.getResourceAdapter().getInboundResourceAdapter();
- if (inboundResourceAdapter == null) {
- inboundResourceAdapter = new InboundResourceadapter();
- connector.getResourceAdapter().setInboundResourceAdapter(inboundResourceAdapter);
- }
-
- MessageAdapter messageAdapter = inboundResourceAdapter.getMessageAdapter();
- if (messageAdapter == null) {
- messageAdapter = new MessageAdapter();
- inboundResourceAdapter.setMessageAdapter(messageAdapter);
- }
-
- classes = finder.findAnnotatedClasses(Activation.class);
- for (Class<?> cls : classes) {
- MessageListener messageListener = null;
- Activation activationAnnotation = cls.getAnnotation(Activation.class);
-
- List<MessageListener> messageListeners = messageAdapter.getMessageListener();
- for (MessageListener ml : messageListeners) {
- if (cls.getName().equals(ml.getActivationSpec().getActivationSpecClass())) {
- messageListener = ml;
- break;
- }
- }
-
- if (messageListener == null) {
- Class<?>[] listeners = activationAnnotation.messageListeners();
- for (Class<?> listener : listeners) {
- messageAdapter.addMessageListener(new MessageListener(listener.getName(), cls.getName()));
- }
- }
- }
-
- classes = finder.findAnnotatedClasses(AdministeredObject.class);
- List<AdminObject> adminObjects = connector.getResourceAdapter().getAdminObject();
- for (Class<?> cls : classes) {
- AdministeredObject administeredObjectAnnotation = cls.getAnnotation(AdministeredObject.class);
- Class[] adminObjectInterfaces = administeredObjectAnnotation.adminObjectInterfaces();
-
- AdminObject adminObject = null;
- for (AdminObject admObj : adminObjects) {
- if (admObj.getAdminObjectClass().equals(cls.getName())) {
- adminObject = admObj;
- }
- }
-
- if (adminObject == null) {
- for (Class iface : adminObjectInterfaces) {
- AdminObject newAdminObject = new AdminObject();
- newAdminObject.setAdminObjectClass(cls.getName());
- newAdminObject.setAdminObjectInterface(iface.getName());
- adminObjects.add(newAdminObject);
- }
- }
- }
-
- // need to make a list of classes to process for config properties
-
- // resource adapter
- String raCls = connector.getResourceAdapter().getResourceAdapterClass();
- process(connectorModule.getClassLoader(), raCls, connector.getResourceAdapter());
-
- // managedconnectionfactory
- if (connector.getResourceAdapter() != null && connector.getResourceAdapter().getOutboundResourceAdapter() != null) {
- List<org.apache.openejb.jee.ConnectionDefinition> connectionDefinitions = connector.getResourceAdapter().getOutboundResourceAdapter().getConnectionDefinition();
- for (org.apache.openejb.jee.ConnectionDefinition connectionDefinition : connectionDefinitions) {
- process(connectorModule.getClassLoader(), connectionDefinition.getManagedConnectionFactoryClass(), connectionDefinition);
- }
- }
-
- // administeredobject
- if (connector.getResourceAdapter() != null) {
- List<AdminObject> raAdminObjects = connector.getResourceAdapter().getAdminObject();
- for (AdminObject raAdminObject : raAdminObjects) {
- process(connectorModule.getClassLoader(), raAdminObject.getAdminObjectClass(), raAdminObject);
- }
- }
-
- // activationspec
- if (connector.getResourceAdapter() != null && connector.getResourceAdapter().getInboundResourceAdapter() != null && connector.getResourceAdapter().getInboundResourceAdapter().getMessageAdapter() != null) {
- List<MessageListener> messageListeners = connector.getResourceAdapter().getInboundResourceAdapter().getMessageAdapter().getMessageListener();
- for (MessageListener messageListener : messageListeners) {
- ActivationSpec activationSpec = messageListener.getActivationSpec();
- process(connectorModule.getClassLoader(), activationSpec.getActivationSpecClass(), activationSpec);
- }
- }
+ if (i < smallIcons) {
+ icon.setSmallIcon(connectorAnnotation.smallIcon()[i]);
+ }
+
+ if (i < largeIcons) {
+ icon.setLargeIcon(connectorAnnotation.largeIcon()[i]);
+ }
+
+ connector.getIcons().add(icon);
+ }
+ }
+
+ if (connector.getLicense() == null) {
+ License license = new License();
+ connector.setLicense(license);
+ license.setLicenseRequired(connectorAnnotation.licenseRequired());
+ }
+
+ connector.getLicense().setDescriptions(getTexts(connector.getLicense().getDescriptions(), connectorAnnotation.licenseDescription()));
+
+
+ SecurityPermission[] annotationSecurityPermissions = connectorAnnotation.securityPermissions();
+ List<org.apache.openejb.jee.SecurityPermission> securityPermission = connector.getResourceAdapter().getSecurityPermission();
+ if (securityPermission == null || securityPermission.size() == 0) {
+ for (SecurityPermission sp : annotationSecurityPermissions) {
+ org.apache.openejb.jee.SecurityPermission permission = new org.apache.openejb.jee.SecurityPermission();
+ permission.setSecurityPermissionSpec(sp.permissionSpec());
+ permission.setDescriptions(stringsToTexts(sp.description()));
+ securityPermission.add(permission);
+ }
+ }
+
+ Class<? extends WorkContext>[] annotationRequiredWorkContexts = connectorAnnotation.requiredWorkContexts();
+ List<String> requiredWorkContext = connector.getRequiredWorkContext();
+ if (requiredWorkContext.size() == 0) {
+ for (Class<? extends WorkContext> cls : annotationRequiredWorkContexts) {
+ requiredWorkContext.add(cls.getName());
+ }
+ }
+
+ OutboundResourceAdapter outboundResourceAdapter = connector.getResourceAdapter().getOutboundResourceAdapter();
+ if (outboundResourceAdapter == null) {
+ outboundResourceAdapter = new OutboundResourceAdapter();
+ connector.getResourceAdapter().setOutboundResourceAdapter(outboundResourceAdapter);
+ }
+
+ List<AuthenticationMechanism> authenticationMechanisms = outboundResourceAdapter.getAuthenticationMechanism();
+ javax.resource.spi.AuthenticationMechanism[] authMechanisms = connectorAnnotation.authMechanisms();
+ if (authenticationMechanisms.size() == 0) {
+ for (javax.resource.spi.AuthenticationMechanism am : authMechanisms) {
+ AuthenticationMechanism authMechanism = new AuthenticationMechanism();
+ authMechanism.setAuthenticationMechanismType(am.authMechanism());
+ authMechanism.setCredentialInterface(am.credentialInterface().toString());
+ authMechanism.setDescriptions(stringsToTexts(am.description()));
+
+ authenticationMechanisms.add(authMechanism);
+ }
+ }
+
+ if (outboundResourceAdapter.getTransactionSupport() == null) {
+ outboundResourceAdapter.setTransactionSupport(TransactionSupportType.fromValue(connectorAnnotation.transactionSupport().toString()));
+ }
+
+ if (outboundResourceAdapter.isReauthenticationSupport() == null) {
+ outboundResourceAdapter.setReauthenticationSupport(connectorAnnotation.reauthenticationSupport());
+ }
+ }
+
+ // process @ConnectionDescription(s)
+ List<Class<?>> classes = finder.findAnnotatedClasses(ConnectionDefinitions.class);
+ for (Class<?> cls : classes) {
+ ConnectionDefinitions connectionDefinitionsAnnotation = cls.getAnnotation(ConnectionDefinitions.class);
+ ConnectionDefinition[] definitions = connectionDefinitionsAnnotation.value();
+
+ for (ConnectionDefinition definition : definitions) {
+ processConnectionDescription(connector.getResourceAdapter(), definition, cls);
+ }
+ }
+
+ classes = finder.findAnnotatedClasses(ConnectionDefinition.class);
+ for (Class<?> cls : classes) {
+ ConnectionDefinition connectionDefinitionAnnotation = cls.getAnnotation(ConnectionDefinition.class);
+ processConnectionDescription(connector.getResourceAdapter(), connectionDefinitionAnnotation, cls);
+ }
+
+
+ InboundResourceadapter inboundResourceAdapter = connector.getResourceAdapter().getInboundResourceAdapter();
+ if (inboundResourceAdapter == null) {
+ inboundResourceAdapter = new InboundResourceadapter();
+ connector.getResourceAdapter().setInboundResourceAdapter(inboundResourceAdapter);
+ }
+
+ MessageAdapter messageAdapter = inboundResourceAdapter.getMessageAdapter();
+ if (messageAdapter == null) {
+ messageAdapter = new MessageAdapter();
+ inboundResourceAdapter.setMessageAdapter(messageAdapter);
+ }
+
+ classes = finder.findAnnotatedClasses(Activation.class);
+ for (Class<?> cls : classes) {
+ MessageListener messageListener = null;
+ Activation activationAnnotation = cls.getAnnotation(Activation.class);
+
+ List<MessageListener> messageListeners = messageAdapter.getMessageListener();
+ for (MessageListener ml : messageListeners) {
+ if (cls.getName().equals(ml.getActivationSpec().getActivationSpecClass())) {
+ messageListener = ml;
+ break;
+ }
+ }
+
+ if (messageListener == null) {
+ Class<?>[] listeners = activationAnnotation.messageListeners();
+ for (Class<?> listener : listeners) {
+ messageAdapter.addMessageListener(new MessageListener(listener.getName(), cls.getName()));
+ }
+ }
+ }
+
+ classes = finder.findAnnotatedClasses(AdministeredObject.class);
+ List<AdminObject> adminObjects = connector.getResourceAdapter().getAdminObject();
+ for (Class<?> cls : classes) {
+ AdministeredObject administeredObjectAnnotation = cls.getAnnotation(AdministeredObject.class);
+ Class[] adminObjectInterfaces = administeredObjectAnnotation.adminObjectInterfaces();
+
+ AdminObject adminObject = null;
+ for (AdminObject admObj : adminObjects) {
+ if (admObj.getAdminObjectClass().equals(cls.getName())) {
+ adminObject = admObj;
+ }
+ }
+
+ if (adminObject == null) {
+ for (Class iface : adminObjectInterfaces) {
+ AdminObject newAdminObject = new AdminObject();
+ newAdminObject.setAdminObjectClass(cls.getName());
+ newAdminObject.setAdminObjectInterface(iface.getName());
+ adminObjects.add(newAdminObject);
+ }
+ }
+ }
+
+ // need to make a list of classes to process for config properties
+
+ // resource adapter
+ String raCls = connector.getResourceAdapter().getResourceAdapterClass();
+ process(connectorModule.getClassLoader(), raCls, connector.getResourceAdapter());
+
+ // managedconnectionfactory
+ if (connector.getResourceAdapter() != null && connector.getResourceAdapter().getOutboundResourceAdapter() != null) {
+ List<org.apache.openejb.jee.ConnectionDefinition> connectionDefinitions = connector.getResourceAdapter().getOutboundResourceAdapter().getConnectionDefinition();
+ for (org.apache.openejb.jee.ConnectionDefinition connectionDefinition : connectionDefinitions) {
+ process(connectorModule.getClassLoader(), connectionDefinition.getManagedConnectionFactoryClass(), connectionDefinition);
+ }
+ }
+
+ // administeredobject
+ if (connector.getResourceAdapter() != null) {
+ List<AdminObject> raAdminObjects = connector.getResourceAdapter().getAdminObject();
+ for (AdminObject raAdminObject : raAdminObjects) {
+ process(connectorModule.getClassLoader(), raAdminObject.getAdminObjectClass(), raAdminObject);
+ }
+ }
+
+ // activationspec
+ if (connector.getResourceAdapter() != null && connector.getResourceAdapter().getInboundResourceAdapter() != null && connector.getResourceAdapter().getInboundResourceAdapter().getMessageAdapter() != null) {
+ List<MessageListener> messageListeners = connector.getResourceAdapter().getInboundResourceAdapter().getMessageAdapter().getMessageListener();
+ for (MessageListener messageListener : messageListeners) {
+ ActivationSpec activationSpec = messageListener.getActivationSpec();
+ process(connectorModule.getClassLoader(), activationSpec.getActivationSpecClass(), activationSpec);
+ }
+ }
return connectorModule;
}
- void process(ClassLoader cl, String cls, Object object) {
+ void process(ClassLoader cl, String cls, Object object) {
- List<ConfigProperty> configProperties = null;
- try {
- // grab a list of ConfigProperty objects
- configProperties = (List<ConfigProperty>) object.getClass().getDeclaredMethod("getConfigProperty").invoke(object);
- } catch (Exception e) {
+ List<ConfigProperty> configProperties = null;
+ try {
+ // grab a list of ConfigProperty objects
+ configProperties = (List<ConfigProperty>) object.getClass().getDeclaredMethod("getConfigProperty").invoke(object);
+ } catch (Exception e) {
// no-op
- }
+ }
+
+ if (configProperties == null) {
+ // can't get config properties
+ return;
+ }
+
+ ClassLoader classLoader = cl;
+ if (classLoader == null) {
+ classLoader = Thread.currentThread().getContextClassLoader();
+ }
+
+ final List<String> allowedTypes = Arrays.asList(new String[] { Boolean.class.getName(), String.class.getName(), Integer.class.getName(), Double.class.getName(), Byte.class.getName(), Short.class.getName(), Long.class.getName(), Float.class.getName(), Character.class.getName()});
+
+ try {
+ Class<?> clazz = classLoader.loadClass(realClassName(cls));
+ Object o = clazz.newInstance();
- if (configProperties == null) {
- // can't get config properties
- return;
- }
-
- ClassLoader classLoader = cl;
- if (classLoader == null) {
- classLoader = Thread.currentThread().getContextClassLoader();
- }
-
- final List<String> allowedTypes = Arrays.asList(new String[] { Boolean.class.getName(), String.class.getName(), Integer.class.getName(), Double.class.getName(), Byte.class.getName(), Short.class.getName(), Long.class.getName(), Float.class.getName(), Character.class.getName()});
-
- try {
- Class<?> clazz = classLoader.loadClass(realClassName(cls));
- Object o = clazz.newInstance();
-
- // add any introspected properties
- BeanInfo beanInfo = Introspector.getBeanInfo(clazz);
- PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
-
- for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
- String name = propertyDescriptor.getName();
- Class<?> type = propertyDescriptor.getPropertyType();
+ // add any introspected properties
+ BeanInfo beanInfo = Introspector.getBeanInfo(clazz);
+ PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
+
+ for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
+ String name = propertyDescriptor.getName();
+ Class<?> type = propertyDescriptor.getPropertyType();
if (type == null) {
continue;
}
- if (type.isPrimitive()) {
- type = getWrapper(type.getName());
- }
-
- if (! allowedTypes.contains(type.getName())) {
- continue;
- }
-
- if (! containsConfigProperty(configProperties, name)) {
- if (type != null) {
- ConfigProperty configProperty = new ConfigProperty();
- configProperties.add(configProperty);
-
- Object value = null;
- try {
- value = propertyDescriptor.getReadMethod().invoke(o);
- } catch (Exception e) {
+ if (type.isPrimitive()) {
+ type = getWrapper(type.getName());
+ }
+
+ if (! allowedTypes.contains(type.getName())) {
+ continue;
+ }
+
+ if (! containsConfigProperty(configProperties, name)) {
+ if (type != null) {
+ ConfigProperty configProperty = new ConfigProperty();
+ configProperties.add(configProperty);
+
+ Object value = null;
+ try {
+ value = propertyDescriptor.getReadMethod().invoke(o);
+ } catch (Exception e) {
// no-op
- }
+ }
- javax.resource.spi.ConfigProperty annotation = propertyDescriptor.getWriteMethod().getAnnotation(javax.resource.spi.ConfigProperty.class);
+ javax.resource.spi.ConfigProperty annotation = propertyDescriptor.getWriteMethod().getAnnotation(javax.resource.spi.ConfigProperty.class);
if (annotation == null) {
try {
// if there's no annotation on the setter, we'll try and scrape one off the field itself (assuming the same name)
@@ -852,198 +852,198 @@ public class AnnotationDeployer implemen
}
}
- configProperty.setConfigPropertyName(name);
- configProperty.setConfigPropertyType(getConfigPropertyType(annotation, type));
- if (value != null) {
- configProperty.setConfigPropertyValue(value.toString());
- }
-
- if (annotation != null) {
- if (annotation.defaultValue() != null && annotation.defaultValue().length() > 0) {
- configProperty.setConfigPropertyValue(annotation.defaultValue());
- }
- configProperty.setConfigPropertyConfidential(annotation.confidential());
- configProperty.setConfigPropertyIgnore(annotation.ignore());
- configProperty.setConfigPropertySupportsDynamicUpdates(annotation.supportsDynamicUpdates());
- configProperty.setDescriptions(stringsToTexts(annotation.description()));
- }
- }
- }
- }
-
- // add any annotated fields we haven't already picked up
- Field[] declaredFields = clazz.getDeclaredFields();
- for (Field field : declaredFields) {
- javax.resource.spi.ConfigProperty annotation = field.getAnnotation(javax.resource.spi.ConfigProperty.class);
-
- String name = field.getName();
- Object value = null;
- try {
- value = field.get(o);
- } catch (Exception e) {
+ configProperty.setConfigPropertyName(name);
+ configProperty.setConfigPropertyType(getConfigPropertyType(annotation, type));
+ if (value != null) {
+ configProperty.setConfigPropertyValue(value.toString());
+ }
+
+ if (annotation != null) {
+ if (annotation.defaultValue() != null && annotation.defaultValue().length() > 0) {
+ configProperty.setConfigPropertyValue(annotation.defaultValue());
+ }
+ configProperty.setConfigPropertyConfidential(annotation.confidential());
+ configProperty.setConfigPropertyIgnore(annotation.ignore());
+ configProperty.setConfigPropertySupportsDynamicUpdates(annotation.supportsDynamicUpdates());
+ configProperty.setDescriptions(stringsToTexts(annotation.description()));
+ }
+ }
+ }
+ }
+
+ // add any annotated fields we haven't already picked up
+ Field[] declaredFields = clazz.getDeclaredFields();
+ for (Field field : declaredFields) {
+ javax.resource.spi.ConfigProperty annotation = field.getAnnotation(javax.resource.spi.ConfigProperty.class);
+
+ String name = field.getName();
+ Object value = null;
+ try {
+ value = field.get(o);
+ } catch (Exception e) {
// no-op
- }
+ }
+
+ if (! containsConfigProperty(configProperties, name)) {
+ String type = getConfigPropertyType(annotation, field.getType());
- if (! containsConfigProperty(configProperties, name)) {
- String type = getConfigPropertyType(annotation, field.getType());
+ if (type != null) {
+ ConfigProperty configProperty = new ConfigProperty();
+ configProperties.add(configProperty);
+
+ configProperty.setConfigPropertyName(name);
+ configProperty.setConfigPropertyType(type);
+ if (value != null) {
+ configProperty.setConfigPropertyValue(value.toString());
+ }
- if (type != null) {
- ConfigProperty configProperty = new ConfigProperty();
- configProperties.add(configProperty);
-
- configProperty.setConfigPropertyName(name);
- configProperty.setConfigPropertyType(type);
- if (value != null) {
- configProperty.setConfigPropertyValue(value.toString());
- }
-
- if (annotation != null) {
- if (annotation.defaultValue() != null) {
- configProperty.setConfigPropertyValue(annotation.defaultValue());
- }
- configProperty.setConfigPropertyConfidential(annotation.confidential());
- configProperty.setConfigPropertyIgnore(annotation.ignore());
- configProperty.setConfigPropertySupportsDynamicUpdates(annotation.supportsDynamicUpdates());
- }
- }
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
+ if (annotation != null) {
+ if (annotation.defaultValue() != null) {
+ configProperty.setConfigPropertyValue(annotation.defaultValue());
+ }
+ configProperty.setConfigPropertyConfidential(annotation.confidential());
+ configProperty.setConfigPropertyIgnore(annotation.ignore());
+ configProperty.setConfigPropertySupportsDynamicUpdates(annotation.supportsDynamicUpdates());
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
- private String getConfigPropertyType(javax.resource.spi.ConfigProperty annotation, Class<?> type) {
- Class<?> t = annotation == null ? null : annotation.type();
+ private String getConfigPropertyType(javax.resource.spi.ConfigProperty annotation, Class<?> type) {
+ Class<?> t = annotation == null ? null : annotation.type();
if (t == null && type != null) {
return type.getName();
} else if (t == null) {
return null;
}
- if (t.equals(Object.class)) {
- t = type;
- }
+ if (t.equals(Object.class)) {
+ t = type;
+ }
if (t == null) { // t == null && type == null
return null;
}
- if (t.isPrimitive()) {
- t = getWrapper(t.getName());
- }
-
- return t.getName();
- }
-
- private boolean containsConfigProperty(List<ConfigProperty> configProperties, String name) {
- for (ConfigProperty configProperty : configProperties) {
- if (configProperty.getConfigPropertyName().equals(name)) {
- return true;
- }
- }
-
- return false;
- }
-
- private Class<?> getWrapper(String primitiveType) {
- final Map<String,Class<?>> builtInMap = new HashMap<String,Class<?>>();{
- builtInMap.put("int", Integer.class);
- builtInMap.put("long", Long.class);
- builtInMap.put("double", Double.class);
- builtInMap.put("float", Float.class);
- builtInMap.put("boolean", Boolean.class);
- builtInMap.put("char", Character.class);
- builtInMap.put("byte", Byte.class);
- builtInMap.put("void", Void.class);
- builtInMap.put("short", Short.class);
- }
-
- return builtInMap.get(primitiveType);
- }
-
- private void processConnectionDescription(ResourceAdapter resourceAdapter, ConnectionDefinition connectionDefinitionAnnotation, Class<?> cls) {
- // try and find the managed connection factory
-
- OutboundResourceAdapter outboundResourceAdapter = resourceAdapter.getOutboundResourceAdapter();
- if (outboundResourceAdapter == null) {
- outboundResourceAdapter = new OutboundResourceAdapter();
- resourceAdapter.setOutboundResourceAdapter(outboundResourceAdapter);
- }
-
- List<org.apache.openejb.jee.ConnectionDefinition> connectionDefinition = outboundResourceAdapter.getConnectionDefinition();
-
- org.apache.openejb.jee.ConnectionDefinition definition = null;
- for (org.apache.openejb.jee.ConnectionDefinition cd : connectionDefinition) {
- if (cd.getManagedConnectionFactoryClass().equals(cls.getName())) {
- definition = cd;
- break;
- }
- }
-
- if (definition == null) {
- definition = new org.apache.openejb.jee.ConnectionDefinition();
- outboundResourceAdapter.getConnectionDefinition().add(definition);
- }
-
- if (definition.getManagedConnectionFactoryClass() == null) {
- definition.setManagedConnectionFactoryClass(cls.getName());
- }
-
- if (definition.getConnectionInterface() == null) {
- definition.setConnectionInterface(connectionDefinitionAnnotation.connection().getName());
- }
-
- if (definition.getConnectionImplClass() == null) {
- definition.setConnectionImplClass(connectionDefinitionAnnotation.connectionImpl().getName());
- }
-
- if (definition.getConnectionFactoryInterface() == null) {
- definition.setConnectionFactoryInterface(connectionDefinitionAnnotation.connectionFactory().getName());
- }
-
- if (definition.getConnectionFactoryImplClass() == null) {
- definition.setConnectionFactoryImplClass(connectionDefinitionAnnotation.connectionFactoryImpl().getName());
- }
- }
-
- private Text[] stringsToTexts(String[] strings) {
- if (strings == null) {
- return null;
- }
-
- Text[] result = new Text[strings.length];
- for (int i = 0; i < result.length; i++) {
- result[i] = new Text();
- result[i].setValue(strings[i]);
- }
-
- return result;
- }
-
- private String getString(String descriptorString, String annotationString) {
- if (descriptorString != null && descriptorString.length() > 0) {
- return descriptorString;
- }
-
- if (annotationString != null && annotationString.length() > 0) {
- return annotationString;
- }
-
- return null;
- }
-
- private Text[] getTexts(Text[] originalTexts, String[] newStrings) {
- if (newStrings != null && newStrings.length > 0 && (originalTexts == null || originalTexts.length == 0)) {
- Text[] texts = new Text[newStrings.length];
- for (int i = 0; i < newStrings.length; i++) {
- texts[i] = new Text(null, newStrings[i]);
- }
-
- return texts;
- } else {
- return originalTexts;
- }
- }
+ if (t.isPrimitive()) {
+ t = getWrapper(t.getName());
+ }
+
+ return t.getName();
+ }
+
+ private boolean containsConfigProperty(List<ConfigProperty> configProperties, String name) {
+ for (ConfigProperty configProperty : configProperties) {
+ if (configProperty.getConfigPropertyName().equals(name)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private Class<?> getWrapper(String primitiveType) {
+ final Map<String,Class<?>> builtInMap = new HashMap<String,Class<?>>();{
+ builtInMap.put("int", Integer.class);
+ builtInMap.put("long", Long.class);
+ builtInMap.put("double", Double.class);
+ builtInMap.put("float", Float.class);
+ builtInMap.put("boolean", Boolean.class);
+ builtInMap.put("char", Character.class);
+ builtInMap.put("byte", Byte.class);
+ builtInMap.put("void", Void.class);
+ builtInMap.put("short", Short.class);
+ }
+
+ return builtInMap.get(primitiveType);
+ }
+
+ private void processConnectionDescription(ResourceAdapter resourceAdapter, ConnectionDefinition connectionDefinitionAnnotation, Class<?> cls) {
+ // try and find the managed connection factory
+
+ OutboundResourceAdapter outboundResourceAdapter = resourceAdapter.getOutboundResourceAdapter();
+ if (outboundResourceAdapter == null) {
+ outboundResourceAdapter = new OutboundResourceAdapter();
+ resourceAdapter.setOutboundResourceAdapter(outboundResourceAdapter);
+ }
+
+ List<org.apache.openejb.jee.ConnectionDefinition> connectionDefinition = outboundResourceAdapter.getConnectionDefinition();
+
+ org.apache.openejb.jee.ConnectionDefinition definition = null;
+ for (org.apache.openejb.jee.ConnectionDefinition cd : connectionDefinition) {
+ if (cd.getManagedConnectionFactoryClass().equals(cls.getName())) {
+ definition = cd;
+ break;
+ }
+ }
+
+ if (definition == null) {
+ definition = new org.apache.openejb.jee.ConnectionDefinition();
+ outboundResourceAdapter.getConnectionDefinition().add(definition);
+ }
+
+ if (definition.getManagedConnectionFactoryClass() == null) {
+ definition.setManagedConnectionFactoryClass(cls.getName());
+ }
+
+ if (definition.getConnectionInterface() == null) {
+ definition.setConnectionInterface(connectionDefinitionAnnotation.connection().getName());
+ }
+
+ if (definition.getConnectionImplClass() == null) {
+ definition.setConnectionImplClass(connectionDefinitionAnnotation.connectionImpl().getName());
+ }
+
+ if (definition.getConnectionFactoryInterface() == null) {
+ definition.setConnectionFactoryInterface(connectionDefinitionAnnotation.connectionFactory().getName());
+ }
+
+ if (definition.getConnectionFactoryImplClass() == null) {
+ definition.setConnectionFactoryImplClass(connectionDefinitionAnnotation.connectionFactoryImpl().getName());
+ }
+ }
+
+ private Text[] stringsToTexts(String[] strings) {
+ if (strings == null) {
+ return null;
+ }
+
+ Text[] result = new Text[strings.length];
+ for (int i = 0; i < result.length; i++) {
+ result[i] = new Text();
+ result[i].setValue(strings[i]);
+ }
+
+ return result;
+ }
+
+ private String getString(String descriptorString, String annotationString) {
+ if (descriptorString != null && descriptorString.length() > 0) {
+ return descriptorString;
+ }
+
+ if (annotationString != null && annotationString.length() > 0) {
+ return annotationString;
+ }
+
+ return null;
+ }
+
+ private Text[] getTexts(Text[] originalTexts, String[] newStrings) {
+ if (newStrings != null && newStrings.length > 0 && (originalTexts == null || originalTexts.length == 0)) {
+ Text[] texts = new Text[newStrings.length];
+ for (int i = 0; i < newStrings.length; i++) {
+ texts[i] = new Text(null, newStrings[i]);
+ }
+
+ return texts;
+ } else {
+ return originalTexts;
+ }
+ }
public WebModule deploy(WebModule webModule) throws OpenEJBException {
WebApp webApp = webModule.getWebApp();
@@ -1854,7 +1854,7 @@ public class AnnotationDeployer implemen
// replace all "/" by "."
if (clientModule.getMainClass().contains("/")) { // className can't be null here
clientModule.setMainClass(className);
- }
+ }
Class clazz;
try {
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java?rev=1547247&r1=1547246&r2=1547247&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java Tue Dec 3 00:30:07 2013
@@ -168,17 +168,17 @@ class AppInfoBuilder {
* JRG - there's probably a better way of handling this, but this code handles the case when:
*
* A connector with two or more inbound adapter is registered, causing two containers named with the format:
- * <moduleId>-<message listener interface>
+ * <moduleId>-<message listener interface>
*
* This code adjusts the container id for the associated MDBs by sticking the message listener interface on the end.
*
*/
if (bean instanceof MessageDrivenBeanInfo && !containerIds.contains(d.getContainerId()) && !skipMdb(bean)) {
- final MessageDrivenBeanInfo mdb = (MessageDrivenBeanInfo) bean;
- final String newContainerId = d.getContainerId() + "-" + mdb.mdbInterface;
- if (containerIds.contains(newContainerId)) {
- d.setContainerId(newContainerId);
- }
+ final MessageDrivenBeanInfo mdb = (MessageDrivenBeanInfo) bean;
+ final String newContainerId = d.getContainerId() + "-" + mdb.mdbInterface;
+ if (containerIds.contains(newContainerId)) {
+ d.setContainerId(newContainerId);
+ }
}
if (!containerIds.contains(d.getContainerId()) && !skipMdb(bean)) {
@@ -526,7 +526,7 @@ class AppInfoBuilder {
}
properties.setProperty("TransactionSupport", transactionSupport);
if (connectorInfo.resourceAdapter != null) {
- properties.setProperty("ResourceAdapter", connectorInfo.resourceAdapter.id);
+ properties.setProperty("ResourceAdapter", connectorInfo.resourceAdapter.id);
}
final ResourceInfo resourceInfo = this.configFactory.configureService(resource, ResourceInfo.class);
@@ -977,7 +977,7 @@ class AppInfoBuilder {
*/
void configureWebserviceSecurity(final EjbJarInfo ejbJarInfo, final EjbModule ejbModule) {
final Object altDD = ejbModule.getOpenejbJar();
- final List<PortInfo> infoList = ejbJarInfo.portInfos;
+ final List<PortInfo> infoList = ejbJarInfo.portInfos;
this.configureWebserviceScurity(infoList, altDD);
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ConnectorModule.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ConnectorModule.java?rev=1547247&r1=1547246&r2=1547247&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ConnectorModule.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ConnectorModule.java Tue Dec 3 00:30:07 2013
@@ -39,7 +39,7 @@ public class ConnectorModule extends Mod
private ID id;
- private IAnnotationFinder finder;
+ private IAnnotationFinder finder;
public ConnectorModule(Connector connector) {
this(connector, Thread.currentThread().getContextClassLoader(), null, null);
@@ -102,11 +102,11 @@ public class ConnectorModule extends Mod
'}';
}
- public IAnnotationFinder getFinder() {
- return finder;
- }
-
- public void setFinder(IAnnotationFinder finder) {
- this.finder = finder;
- }
+ public IAnnotationFinder getFinder() {
+ return finder;
+ }
+
+ public void setFinder(IAnnotationFinder finder) {
+ this.finder = finder;
+ }
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/VmDeploymentManager.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/VmDeploymentManager.java?rev=1547247&r1=1547246&r2=1547247&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/VmDeploymentManager.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/VmDeploymentManager.java Tue Dec 3 00:30:07 2013
@@ -105,8 +105,8 @@ public class VmDeploymentManager impleme
}
private Deployer getDeployer() {
- String deployerJndi = System.getProperty("openejb.deployer.jndiname", "openejb/DeployerBusinessRemote");
-
+ String deployerJndi = System.getProperty("openejb.deployer.jndiname", "openejb/DeployerBusinessRemote");
+
if (deployer == null) {
try {
Properties p = new Properties();
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/WsDeployer.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/WsDeployer.java?rev=1547247&r1=1547246&r2=1547247&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/WsDeployer.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/WsDeployer.java Tue Dec 3 00:30:07 2013
@@ -295,11 +295,11 @@ public class WsDeployer implements Dynam
// when to webservices.xml is defined and when we want to
// publish more than one port for the same implementation by configuration
portComponent.setPortComponentName(sessionBean.getEjbName());
-
- } else { // JAX-WS Metadata specification default
- portComponent.setPortComponentName(JaxWsUtils.getPortQName(ejbClass).getLocalPart());
-
- }
+
+ } else { // JAX-WS Metadata specification default
+ portComponent.setPortComponentName(JaxWsUtils.getPortQName(ejbClass).getLocalPart());
+
+ }
webserviceDescription.getPortComponent().add(portComponent);
ServiceImplBean serviceImplBean = new ServiceImplBean();
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckClasses.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckClasses.java?rev=1547247&r1=1547246&r2=1547247&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckClasses.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckClasses.java Tue Dec 3 00:30:07 2013
@@ -210,9 +210,9 @@ public class CheckClasses extends Valida
for (Object item : clazz.getAnnotations()) { item.toString(); }
// checking for any declared enum constants
for(Class klass: clazz.getClasses()){
- if(klass.isEnum()){
- klass.toString();
- }
+ if(klass.isEnum()){
+ klass.toString();
+ }
}
} catch (ClassNotFoundException e) {
/*
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/ReflectionInvocationContext.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/ReflectionInvocationContext.java?rev=1547247&r1=1547246&r2=1547247&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/ReflectionInvocationContext.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/ReflectionInvocationContext.java Tue Dec 3 00:30:07 2013
@@ -112,14 +112,14 @@ public class ReflectionInvocationContext
", but got a parameter that is null");
}
} else {
- //check that types are applicable
- Class<?> actual = Classes.deprimitivize(parameterType);
- Class<?> given = Classes.deprimitivize(parameter.getClass());
-
- if (!actual.isAssignableFrom(given)) {
+ //check that types are applicable
+ Class<?> actual = Classes.deprimitivize(parameterType);
+ Class<?> given = Classes.deprimitivize(parameter.getClass());
+
+ if (!actual.isAssignableFrom(given)) {
throw new IllegalArgumentException("Expected parameter " + i + " to be of type " + parameterType.getName() +
- ", but got a parameter of type " + parameter.getClass().getName());
- }
+ ", but got a parameter of type " + parameter.getClass().getName());
+ }
}
}
System.arraycopy(parameters, 0, this.parameters, 0, parameters.length);
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/naming/IvmContext.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/naming/IvmContext.java?rev=1547247&r1=1547246&r2=1547247&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/naming/IvmContext.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/naming/IvmContext.java Tue Dec 3 00:30:07 2013
@@ -151,7 +151,7 @@ public class IvmContext implements Conte
// don't cache proxies
if (!(obj instanceof IntraVmProxy) && !(obj instanceof ContextualJndiReference)) {
- fastCache.put(compoundName, obj);
+ fastCache.put(compoundName, obj);
}
}
@@ -396,8 +396,8 @@ public class IvmContext implements Conte
int indx = name.indexOf(":");
if (indx > -1) {
/*
- The ':' character will be in the path if its an absolute path name starting with the schema
- 'java:'. We strip the schema off the path before passing it to the node.resolve method.
+ The ':' character will be in the path if its an absolute path name starting with the schema
+ 'java:'. We strip the schema off the path before passing it to the node.resolve method.
*/
name = name.substring(indx + 1);
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/security/ConnectorCallbackHandler.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/security/ConnectorCallbackHandler.java?rev=1547247&r1=1547246&r2=1547247&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/security/ConnectorCallbackHandler.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/security/ConnectorCallbackHandler.java Tue Dec 3 00:30:07 2013
@@ -42,56 +42,56 @@ import java.util.List;
*/
public class ConnectorCallbackHandler implements CallbackHandler {
- private Principal callerPrincipal;
- private String[] groupsArray;
- private final String securityRealmName;
-
- public ConnectorCallbackHandler(String securityRealmName) {
- this.securityRealmName = securityRealmName;
- }
-
- public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
- for (Callback callback : callbacks) {
- // jaspi to server communication
- if (callback instanceof CallerPrincipalCallback) {
- callerPrincipal = ((CallerPrincipalCallback) callback).getPrincipal();
- } else if (callback instanceof GroupPrincipalCallback) {
- groupsArray = ((GroupPrincipalCallback) callback).getGroups();
- } else if (callback instanceof PasswordValidationCallback) {
- PasswordValidationCallback passwordValidationCallback = (PasswordValidationCallback) callback;
- final String userName = passwordValidationCallback.getUsername();
- final char[] password = passwordValidationCallback.getPassword();
-
- SecurityService securityService = SystemInstance.get().getComponent(SecurityService.class);
- try {
- Object loginObj = securityService.login(securityRealmName, userName, password == null ? "" : new String(password));
- securityService.associate(loginObj);
- callerPrincipal = securityService.getCallerPrincipal();
- passwordValidationCallback.setResult(true);
- } catch (LoginException e) {
- passwordValidationCallback.setResult(false);
- }
- }
- // server to jaspi communication
- else if (callback instanceof CertStoreCallback) { //NOPMD
+ private Principal callerPrincipal;
+ private String[] groupsArray;
+ private final String securityRealmName;
+
+ public ConnectorCallbackHandler(String securityRealmName) {
+ this.securityRealmName = securityRealmName;
+ }
+
+ public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
+ for (Callback callback : callbacks) {
+ // jaspi to server communication
+ if (callback instanceof CallerPrincipalCallback) {
+ callerPrincipal = ((CallerPrincipalCallback) callback).getPrincipal();
+ } else if (callback instanceof GroupPrincipalCallback) {
+ groupsArray = ((GroupPrincipalCallback) callback).getGroups();
+ } else if (callback instanceof PasswordValidationCallback) {
+ PasswordValidationCallback passwordValidationCallback = (PasswordValidationCallback) callback;
+ final String userName = passwordValidationCallback.getUsername();
+ final char[] password = passwordValidationCallback.getPassword();
+
+ SecurityService securityService = SystemInstance.get().getComponent(SecurityService.class);
+ try {
+ Object loginObj = securityService.login(securityRealmName, userName, password == null ? "" : new String(password));
+ securityService.associate(loginObj);
+ callerPrincipal = securityService.getCallerPrincipal();
+ passwordValidationCallback.setResult(true);
+ } catch (LoginException e) {
+ passwordValidationCallback.setResult(false);
+ }
+ }
+ // server to jaspi communication
+ else if (callback instanceof CertStoreCallback) { //NOPMD
// TODO implement me
- } else if (callback instanceof PrivateKeyCallback) { //NOPMD
+ } else if (callback instanceof PrivateKeyCallback) { //NOPMD
// TODO implement me
- } else if (callback instanceof SecretKeyCallback) { //NOPMD
+ } else if (callback instanceof SecretKeyCallback) { //NOPMD
// TODO implement me
- } else if (callback instanceof TrustStoreCallback) { //NOPMD
+ } else if (callback instanceof TrustStoreCallback) { //NOPMD
// TODO implement me
- } else {
- throw new UnsupportedCallbackException(callback);
- }
- }
- }
-
- public Principal getCallerPrincipal() {
- return callerPrincipal;
- }
-
- public List<String> getGroups() {
- return groupsArray == null ? null : Arrays.asList(groupsArray);
- }
+ } else {
+ throw new UnsupportedCallbackException(callback);
+ }
+ }
+ }
+
+ public Principal getCallerPrincipal() {
+ return callerPrincipal;
+ }
+
+ public List<String> getGroups() {
+ return groupsArray == null ? null : Arrays.asList(groupsArray);
+ }
}
\ No newline at end of file