You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2005/08/17 08:46:20 UTC
svn commit: r233130 - in /geronimo/trunk/modules:
connector-builder/src/java/org/apache/geronimo/connector/deployment/
connector-builder/src/java/org/apache/geronimo/connector/deployment/dconfigbean/
connector-builder/src/schema/ connector-builder/src/...
Author: djencks
Date: Tue Aug 16 23:46:06 2005
New Revision: 233130
URL: http://svn.apache.org/viewcvs?rev=233130&view=rev
Log:
GERONIMO-881 remove realm-bridge concept, it was a bad idea.
Added:
geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/security/CallerIdentityPasswordCredentialLoginModule.java
- copied, changed from r232767, geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialLoginModule.java
geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialLoginModuleWrapper.java
geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialLoginModuleWrapperGBean.java
Removed:
geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/security/ManagedConnectionFactoryListener.java
geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialLoginModule.java
geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialRealm.java
geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialRealmGBean.java
geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/bridge/
geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/bridge/
Modified:
geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionInstance.java
geronimo/trunk/modules/connector-builder/src/schema/geronimo-connector_1_5.xsd
geronimo/trunk/modules/connector-builder/src/test-data/connector_1_0/geronimo-ra.xml
geronimo/trunk/modules/connector-builder/src/test-data/connector_1_5/geronimo-ra.xml
geronimo/trunk/modules/connector-builder/src/test-data/data/dup-connectionfactoryinstance-name.xml
geronimo/trunk/modules/connector-builder/src/test-data/data/external-application-plan.xml
geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/GenericConnectionManager.java
geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/GenericConnectionManagerGBean.java
geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java
geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperGBean.java
geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/SubjectInterceptor.java
geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionInterceptorTestUtils.java
geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerStressTest.java
geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerTestUtils.java
geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/SubjectInterceptorTest.java
geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/AbstractTest.java
Modified: geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java?rev=233130&r1=233129&r2=233130&view=diff
==============================================================================
--- geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java (original)
+++ geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java Tue Aug 16 23:46:06 2005
@@ -60,7 +60,6 @@
import org.apache.geronimo.connector.outbound.connectionmanagerconfig.TransactionLog;
import org.apache.geronimo.connector.outbound.connectionmanagerconfig.TransactionSupport;
import org.apache.geronimo.connector.outbound.connectionmanagerconfig.XATransactions;
-import org.apache.geronimo.connector.outbound.security.PasswordCredentialRealmGBean;
import org.apache.geronimo.deployment.service.ServiceConfigBuilder;
import org.apache.geronimo.deployment.util.DeploymentUtil;
import org.apache.geronimo.deployment.xbeans.DependencyType;
@@ -85,7 +84,6 @@
import org.apache.geronimo.naming.deployment.ENCConfigBuilder;
import org.apache.geronimo.naming.reference.ResourceReference;
import org.apache.geronimo.schema.SchemaConversionUtils;
-import org.apache.geronimo.security.bridge.AbstractRealmBridge;
import org.apache.geronimo.xbeans.geronimo.GerAdminobjectInstanceType;
import org.apache.geronimo.xbeans.geronimo.GerAdminobjectType;
import org.apache.geronimo.xbeans.geronimo.GerConfigPropertySettingType;
@@ -113,7 +111,6 @@
* @version $Rev$ $Date$
*/
public class ConnectorModuleBuilder implements ModuleBuilder, ResourceReferenceBuilder {
- private static final String BASE_PASSWORD_CREDENTIAL_LOGIN_MODULE_NAME = "geronimo.security:service=Realm,type=PasswordCredential,name=";
private final int defaultMaxSize;
private final int defaultMinSize;
@@ -738,11 +735,7 @@
connectionManagerGBean.setAttribute("transactionSupport", transactionSupport);
connectionManagerGBean.setAttribute("pooling", pooling);
connectionManagerGBean.setReferencePattern("ConnectionTracker", earContext.getConnectionTrackerObjectName());
- if (connectionManager.getRealmBridge() != null) {
- //TODO eliminate RealmBridge or find a better name
- ObjectName realmBridgeName = NameFactory.getComponentName(null, null, null, null, connectionManager.getRealmBridge().trim(), AbstractRealmBridge.GBEAN_INFO.getJ2eeType(), j2eeContext);
- connectionManagerGBean.setReferencePattern("RealmBridge", realmBridgeName);
- }
+ connectionManagerGBean.setAttribute("containerManagedSecurity", new Boolean(connectionManager.isSetContainerManagedSecurity()));
connectionManagerGBean.setReferencePattern("TransactionContextManager", earContext.getTransactionContextManagerObjectName());
} catch (Exception e) {
throw new DeploymentException("Problem setting up ConnectionManager", e);
@@ -773,13 +766,6 @@
managedConnectionFactoryInstanceGBeanData.setReferencePattern("ResourceAdapterWrapper", resourceAdapterObjectName);
}
managedConnectionFactoryInstanceGBeanData.setReferencePattern("ConnectionManagerContainer", connectionManagerObjectName);
- if (connectiondefinitionInstance.getCredentialInterface() != null && GerCredentialInterfaceType.Enum.forString("javax.resource.spi.security.PasswordCredential").equals(connectiondefinitionInstance.getCredentialInterface())) {
- ObjectName realmObjectName = ObjectName.getInstance(BASE_PASSWORD_CREDENTIAL_LOGIN_MODULE_NAME + connectiondefinitionInstance.getName());
- GBeanData realmGBean = new GBeanData(realmObjectName, PasswordCredentialRealmGBean.getGBeanInfo());
- realmGBean.setAttribute("realmName", BASE_PASSWORD_CREDENTIAL_LOGIN_MODULE_NAME + connectiondefinitionInstance.getName());
- earContext.addGBean(realmGBean);
- managedConnectionFactoryInstanceGBeanData.setReferencePattern("ManagedConnectionFactoryListener", realmObjectName);
- }
//additional interfaces implemented by connection factory
String[] implementedInterfaces = connectiondefinitionInstance.getImplementedInterfaceArray();
if (implementedInterfaces != null) {
Modified: geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionInstance.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionInstance.java?rev=233130&r1=233129&r2=233130&view=diff
==============================================================================
--- geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionInstance.java (original)
+++ geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/dconfigbean/ConnectionDefinitionInstance.java Tue Aug 16 23:46:06 2005
@@ -199,14 +199,18 @@
// pcs.firePropertyChange("blockingTimeout", old, blockingTimeout);
// }
- public String getRealmBridgeName() {
- return getConnectionManager().getRealmBridge();
+ public boolean isContainerManagedSecurity() {
+ return getConnectionManager().isSetContainerManagedSecurity();
}
- public void setRealmBridgeName(String realmBridgeName) {
- String old = getRealmBridgeName();
- getConnectionManager().setRealmBridge(realmBridgeName);
- pcs.firePropertyChange("realmBridgeName", old, realmBridgeName);
+ public void setContainerManagedSecurity(boolean containerManagedSecurity) {
+ boolean old = isContainerManagedSecurity();
+ if (old && !containerManagedSecurity) {
+ getConnectionManager().setContainerManagedSecurity(null);
+ } else if (!old && containerManagedSecurity) {
+ getConnectionManager().addNewContainerManagedSecurity();
+ }
+ pcs.firePropertyChange("containerManagedSecurity", old, containerManagedSecurity);
}
public String toString() {
Modified: geronimo/trunk/modules/connector-builder/src/schema/geronimo-connector_1_5.xsd
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector-builder/src/schema/geronimo-connector_1_5.xsd?rev=233130&r1=233129&r2=233130&view=diff
==============================================================================
--- geronimo/trunk/modules/connector-builder/src/schema/geronimo-connector_1_5.xsd (original)
+++ geronimo/trunk/modules/connector-builder/src/schema/geronimo-connector_1_5.xsd Tue Aug 16 23:46:06 2005
@@ -23,8 +23,7 @@
targetNamespace="http://geronimo.apache.org/xml/ns/j2ee/connector"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.5">
+ attributeFormDefault="unqualified">
<xs:import namespace="http://geronimo.apache.org/xml/ns/naming" schemaLocation="geronimo-naming.xsd"/>
<xs:import namespace="http://geronimo.apache.org/xml/ns/deployment" schemaLocation="geronimo-config.xsd"/>
@@ -241,51 +240,48 @@
</xs:annotation>
<xs:sequence>
- <!--realm-bridge is an object name-->
- <xs:element name="realm-bridge"
- type="xs:string"
- minOccurs="0"/>
+ <xs:element name="container-managed-security" type="ger:emptyType" minOccurs="0"/>
<xs:choice minOccurs="0">
- <xs:element name="no-transaction"/>
- <xs:element name="local-transaction"/>
- <xs:element name="xa-transaction" type="ger:xatransaction-Type"/>
- <xs:element name="transaction-log"/>
+ <xs:element name="no-transaction" type="ger:emptyType"/>
+ <xs:element name="local-transaction" type="ger:emptyType"/>
+ <xs:element name="xa-transaction" type="ger:xatransactionType"/>
+ <xs:element name="transaction-log" type="ger:emptyType"/>
</xs:choice>
<xs:choice>
- <xs:element name="no-pool"/>
- <xs:element name="single-pool" type="ger:singlepool-Type"/>
- <xs:element name="partitioned-pool" type="ger:partitionedpool-Type"/>
+ <xs:element name="no-pool" type="ger:emptyType"/>
+ <xs:element name="single-pool" type="ger:singlepoolType"/>
+ <xs:element name="partitioned-pool" type="ger:partitionedpoolType"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="xatransaction-Type">
+ <xs:complexType name="xatransactionType">
<xs:sequence>
- <xs:element name="transaction-caching" minOccurs="0"/>
- <xs:element name="thread-caching" minOccurs="0"/>
+ <xs:element name="transaction-caching" type="ger:emptyType" minOccurs="0"/>
+ <xs:element name="thread-caching" type="ger:emptyType" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="singlepool-Type">
+ <xs:complexType name="singlepoolType">
<xs:sequence>
<xs:element name="max-size" type="xs:int" minOccurs="0"/>
<xs:element name="min-size" type="xs:int" minOccurs="0"/>
<xs:element name="blocking-timeout-milliseconds" type="xs:int" minOccurs="0"/>
<xs:element name="idle-timeout-minutes" type="xs:int" minOccurs="0"/>
<xs:choice>
- <xs:element name="match-one"/>
- <xs:element name="match-all"/>
- <xs:element name="select-one-assume-match"/>
+ <xs:element name="match-one" type="ger:emptyType"/>
+ <xs:element name="match-all" type="ger:emptyType"/>
+ <xs:element name="select-one-assume-match" type="ger:emptyType"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
- <xs:complexType name="partitionedpool-Type">
+ <xs:complexType name="partitionedpoolType">
<complexContent>
- <extension base="ger:singlepool-Type">
+ <extension base="ger:singlepoolType">
<xs:sequence>
- <xs:element name="partition-by-subject" minOccurs="0"/>
- <xs:element name="partition-by-connectionrequestinfo" minOccurs="0"/>
+ <xs:element name="partition-by-subject" type="ger:emptyType" minOccurs="0"/>
+ <xs:element name="partition-by-connectionrequestinfo" type="ger:emptyType" minOccurs="0"/>
</xs:sequence>
</extension>
</complexContent>
@@ -312,7 +308,7 @@
<!-- <xs:element name="gbean" type="sys:gbeanType" minOccurs="0" maxOccurs="unbounded"/>-->
</xs:sequence>
- <xs:attribute name="version" type="ger:versionType" use="required"/>
+ <xs:attribute name="version" type="ger:versionType" use="optional"/>
<xs:attribute name="configId" type="xs:string" use="required"/>
<xs:attribute name="parentId" type="xs:string" use="optional"/>
</xs:complexType>
@@ -356,6 +352,8 @@
value="javax.resource.spi.security.GenericCredential"/>
</xs:restriction>
</xs:simpleType>
+
+ <xs:complexType name="emptyType"/>
<!-- **************************************************** -->
Modified: geronimo/trunk/modules/connector-builder/src/test-data/connector_1_0/geronimo-ra.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector-builder/src/test-data/connector_1_0/geronimo-ra.xml?rev=233130&r1=233129&r2=233130&view=diff
==============================================================================
--- geronimo/trunk/modules/connector-builder/src/test-data/connector_1_0/geronimo-ra.xml (original)
+++ geronimo/trunk/modules/connector-builder/src/test-data/connector_1_0/geronimo-ra.xml Tue Aug 16 23:46:06 2005
@@ -29,7 +29,7 @@
<config-property-setting name="OutboundStringProperty1">newvalue1</config-property-setting>
<config-property-setting name="OutboundStringProperty3">newvalue2</config-property-setting>
<connectionmanager>
- <realm-bridge>TargetRealm</realm-bridge>
+ <container-managed-security/>
<xa-transaction>
<transaction-caching/>
</xa-transaction>
@@ -62,7 +62,7 @@
<name>ThirdTestOutboundConnectionFactory</name>
<config-property-setting name="OutboundStringProperty1">StringValue3</config-property-setting>
<connectionmanager>
- <realm-bridge>TargetRealm</realm-bridge>
+ <container-managed-security/>
<xa-transaction>
<transaction-caching/>
</xa-transaction>
@@ -80,12 +80,6 @@
<!--normally this is in the j2ee-server-plan.xml. It is included here so the gbeans can start in unit tests-->
<gbean name="ConnectionTracker" class="org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinatorGBean">
- </gbean>
-
- <gbean name="TargetRealm" class="org.apache.geronimo.security.bridge.ConfiguredIdentityUserPasswordRealmBridge">
- <attribute name="targetRealm">TargetRealm</attribute>
- <attribute name="configuredUser">testUser</attribute>
- <attribute name="configuredPassword">testPassword</attribute>
</gbean>
</connector>
Modified: geronimo/trunk/modules/connector-builder/src/test-data/connector_1_5/geronimo-ra.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector-builder/src/test-data/connector_1_5/geronimo-ra.xml?rev=233130&r1=233129&r2=233130&view=diff
==============================================================================
--- geronimo/trunk/modules/connector-builder/src/test-data/connector_1_5/geronimo-ra.xml (original)
+++ geronimo/trunk/modules/connector-builder/src/test-data/connector_1_5/geronimo-ra.xml Tue Aug 16 23:46:06 2005
@@ -36,7 +36,7 @@
<config-property-setting name="OutboundStringProperty1">newvalue1</config-property-setting>
<config-property-setting name="OutboundStringProperty3">newvalue2</config-property-setting>
<connectionmanager>
- <realm-bridge>TargetRealm</realm-bridge>
+ <container-managed-security/>
<xa-transaction>
<transaction-caching/>
</xa-transaction>
@@ -47,7 +47,6 @@
<partition-by-subject/>
</partitioned-pool>
</connectionmanager>
- <global-jndi-name>connectionfactories/testcf</global-jndi-name>
<credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
</connectiondefinition-instance>
<connectiondefinition-instance>
@@ -55,7 +54,7 @@
<config-property-setting name="OutboundStringProperty4">newvalue3</config-property-setting>
<config-property-setting name="OutboundStringProperty1">newvalue4</config-property-setting>
<connectionmanager>
- <realm-bridge>TargetRealm</realm-bridge>
+ <container-managed-security/>
<xa-transaction>
<transaction-caching/>
</xa-transaction>
@@ -74,7 +73,7 @@
<name>ThirdTestOutboundConnectionFactory</name>
<config-property-setting name="OutboundStringProperty1">StringValue3</config-property-setting>
<connectionmanager>
- <realm-bridge>TargetRealm</realm-bridge>
+ <container-managed-security/>
<xa-transaction>
<transaction-caching/>
</xa-transaction>
@@ -125,12 +124,6 @@
<gbean name="TransactionContextManager" class="org.apache.geronimo.transaction.context.TransactionContextManager">
<reference name="TransactionManager"><gbean-name>*:name=TransactionManager,*</gbean-name></reference>
<reference name="XidImporter"><gbean-name>*:name=TransactionManager,*</gbean-name></reference>
- </gbean>
-
- <gbean name="TargetRealm" class="org.apache.geronimo.security.bridge.ConfiguredIdentityUserPasswordRealmBridge">
- <attribute name="targetRealm">TargetRealm</attribute>
- <attribute name="configuredUser">testUser</attribute>
- <attribute name="configuredPassword">testPassword</attribute>
</gbean>
</connector>
Modified: geronimo/trunk/modules/connector-builder/src/test-data/data/dup-connectionfactoryinstance-name.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector-builder/src/test-data/data/dup-connectionfactoryinstance-name.xml?rev=233130&r1=233129&r2=233130&view=diff
==============================================================================
--- geronimo/trunk/modules/connector-builder/src/test-data/data/dup-connectionfactoryinstance-name.xml (original)
+++ geronimo/trunk/modules/connector-builder/src/test-data/data/dup-connectionfactoryinstance-name.xml Tue Aug 16 23:46:06 2005
@@ -34,7 +34,7 @@
<config-property-setting name="OutboundStringProperty1">newvalue1</config-property-setting>
<config-property-setting name="OutboundStringProperty3">newvalue2</config-property-setting>
<connectionmanager>
- <realm-bridge>TargetRealm</realm-bridge>
+ <container-managed-security/>
<xa-transaction>
<transaction-caching/>
</xa-transaction>
@@ -65,7 +65,7 @@
<config-property-setting name="OutboundStringProperty1">newvalue1</config-property-setting>
<config-property-setting name="OutboundStringProperty3">newvalue2</config-property-setting>
<connectionmanager>
- <realm-bridge>TargetRealm</realm-bridge>
+ <container-managed-security/>
<xa-transaction>
<transaction-caching/>
</xa-transaction>
Modified: geronimo/trunk/modules/connector-builder/src/test-data/data/external-application-plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector-builder/src/test-data/data/external-application-plan.xml?rev=233130&r1=233129&r2=233130&view=diff
==============================================================================
--- geronimo/trunk/modules/connector-builder/src/test-data/data/external-application-plan.xml (original)
+++ geronimo/trunk/modules/connector-builder/src/test-data/data/external-application-plan.xml Tue Aug 16 23:46:06 2005
@@ -36,7 +36,7 @@
<config-property-setting name="OutboundStringProperty1">newvalue1</config-property-setting>
<config-property-setting name="OutboundStringProperty3">newvalue2</config-property-setting>
<connectionmanager>
- <realm-bridge>TargetRealm</realm-bridge>
+ <container-managed-security/>
<xa-transaction>
<transaction-caching/>
</xa-transaction>
@@ -70,7 +70,7 @@
<name>ThirdTestOutboundConnectionFactory</name>
<config-property-setting name="OutboundStringProperty1">StringValue3</config-property-setting>
<connectionmanager>
- <realm-bridge>TargetRealm</realm-bridge>
+ <container-managed-security/>
<partitioned-pool>
<match-one/>
<partition-by-subject/>
@@ -105,7 +105,7 @@
<config-property-setting name="OutboundStringProperty1">newvalue1</config-property-setting>
<config-property-setting name="OutboundStringProperty3">newvalue2</config-property-setting>
<connectionmanager>
- <realm-bridge>TargetRealm</realm-bridge>
+ <container-managed-security/>
<xa-transaction>
<transaction-caching/>
</xa-transaction>
@@ -124,7 +124,7 @@
<config-property-setting name="OutboundStringProperty4">newvalue3</config-property-setting>
<config-property-setting name="OutboundStringProperty1">newvalue4</config-property-setting>
<connectionmanager>
- <realm-bridge>TargetRealm</realm-bridge>
+ <container-managed-security/>
<xa-transaction>
<transaction-caching/>
</xa-transaction>
@@ -144,7 +144,7 @@
<name>ThirdTestOutboundConnectionFactory</name>
<config-property-setting name="OutboundStringProperty1">StringValue3</config-property-setting>
<connectionmanager>
- <realm-bridge>TargetRealm</realm-bridge>
+ <container-managed-security/>
<partitioned-pool>
<match-one/>
<partition-by-subject/>
@@ -171,7 +171,7 @@
</connector>
</module>
-
+
<!--normally this is in the j2ee-server-plan.xml. It is included here so the gbeans can start in unit tests-->
<gbean name="ConnectionTracker" class="org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinatorGBean">
</gbean>
@@ -194,12 +194,6 @@
<gbean name="TransactionContextManager" class="org.apache.geronimo.transaction.context.TransactionContextManager">
<reference name="TransactionManager"><gbean-name>*:name=TransactionManager,*</gbean-name></reference>
<reference name="XidImporter"><gbean-name>*:name=TransactionManager,*</gbean-name></reference>
- </gbean>
-
- <gbean name="TargetRealm" class="org.apache.geronimo.security.bridge.ConfiguredIdentityUserPasswordRealmBridge">
- <attribute name="targetRealm">TargetRealm</attribute>
- <attribute name="configuredUser">testUser</attribute>
- <attribute name="configuredPassword">testPassword</attribute>
</gbean>
</application>
Modified: geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java?rev=233130&r1=233129&r2=233130&view=diff
==============================================================================
--- geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java (original)
+++ geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java Tue Aug 16 23:46:06 2005
@@ -480,8 +480,8 @@
ObjectName firstOutCF = NameFactory.getComponentName(null, null, null, null, null, "FirstTestOutboundConnectionFactory", NameFactory.JCA_CONNECTION_FACTORY, j2eeContext);
assertRunning(kernel, firstOutCF);
- ObjectName firstOutSecurity = new ObjectName("geronimo.security:service=Realm,type=PasswordCredential,name=FirstTestOutboundConnectionFactory");
- assertRunning(kernel, firstOutSecurity);
+// ObjectName firstOutSecurity = new ObjectName("geronimo.security:service=Realm,type=PasswordCredential,name=FirstTestOutboundConnectionFactory");
+// assertRunning(kernel, firstOutSecurity);
ObjectName firstOutMCF = NameFactory.getComponentName(null, null, null, null, null, "FirstTestOutboundConnectionFactory", NameFactory.JCA_MANAGED_CONNECTION_FACTORY, j2eeContext);
assertRunning(kernel, firstOutMCF);
Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/GenericConnectionManager.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/GenericConnectionManager.java?rev=233130&r1=233129&r2=233130&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/GenericConnectionManager.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/GenericConnectionManager.java Tue Aug 16 23:46:06 2005
@@ -21,7 +21,6 @@
import org.apache.geronimo.connector.outbound.connectionmanagerconfig.PoolingSupport;
import org.apache.geronimo.connector.outbound.connectionmanagerconfig.TransactionSupport;
import org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTracker;
-import org.apache.geronimo.security.bridge.RealmBridge;
import org.apache.geronimo.transaction.context.TransactionContextManager;
/**
@@ -39,13 +38,12 @@
public GenericConnectionManager(TransactionSupport transactionSupport,
PoolingSupport pooling,
- RealmBridge realmBridge,
+ boolean containerManagedSecurity,
ConnectionTracker connectionTracker,
TransactionContextManager transactionContextManager,
String objectName,
- ClassLoader classLoader
- ) {
- super(new InterceptorsImpl(transactionSupport, pooling, objectName, realmBridge, connectionTracker, transactionContextManager, classLoader));
+ ClassLoader classLoader) {
+ super(new InterceptorsImpl(transactionSupport, pooling, containerManagedSecurity, objectName, connectionTracker, transactionContextManager, classLoader));
}
private static class InterceptorsImpl implements AbstractConnectionManager.Interceptors {
@@ -69,13 +67,13 @@
*/
public InterceptorsImpl(TransactionSupport transactionSupport,
PoolingSupport pooling,
+ boolean containerManagedSecurity,
String objectName,
- RealmBridge realmBridge,
ConnectionTracker connectionTracker,
TransactionContextManager transactionContextManager,
ClassLoader classLoader) {
//check for consistency between attributes
- if (realmBridge == null && pooling instanceof PartitionedPool && ((PartitionedPool) pooling).isPartitionBySubject()) {
+ if (!containerManagedSecurity && pooling instanceof PartitionedPool && ((PartitionedPool) pooling).isPartitionBySubject()) {
throw new IllegalStateException("To use Subject in pooling, you need a SecurityDomain");
}
@@ -86,15 +84,10 @@
stack = transactionSupport.addXAResourceInsertionInterceptor(stack, objectName);
stack = pooling.addPoolingInterceptors(stack);
this.poolingSupport = pooling;
- //experimental threadlocal caching
- //moved to XATransactions
-// if (transactionSupport instanceof XATransactions && ((XATransactions)transactionSupport).isUseThreadCaching()) {
-// stack = new ThreadLocalCachingConnectionInterceptor(stack, false);
-// }
stack = transactionSupport.addTransactionInterceptors(stack, transactionContextManager);
- if (realmBridge != null) {
- stack = new SubjectInterceptor(stack, realmBridge);
+ if (containerManagedSecurity) {
+ stack = new SubjectInterceptor(stack);
}
ConnectionInterceptor recoveryStack = stack;
Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/GenericConnectionManagerGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/GenericConnectionManagerGBean.java?rev=233130&r1=233129&r2=233130&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/GenericConnectionManagerGBean.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/GenericConnectionManagerGBean.java Tue Aug 16 23:46:06 2005
@@ -22,11 +22,10 @@
import org.apache.geronimo.gbean.GBeanInfo;
import org.apache.geronimo.gbean.GBeanInfoBuilder;
import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.security.bridge.RealmBridge;
import org.apache.geronimo.transaction.context.TransactionContextManager;
/**
- *
+ *
* @version $Revision$
*/
public class GenericConnectionManagerGBean {
@@ -38,18 +37,18 @@
infoBuilder.addAttribute("transactionSupport", TransactionSupport.class, true);
infoBuilder.addAttribute("pooling", PoolingSupport.class, true);
+ infoBuilder.addAttribute("containerManagedSecurity", Boolean.TYPE, true);
infoBuilder.addAttribute("objectName", String.class, false);
infoBuilder.addAttribute("classLoader", ClassLoader.class, false);
infoBuilder.addReference("ConnectionTracker", ConnectionTracker.class, NameFactory.JCA_CONNECTION_TRACKER);
- infoBuilder.addReference("RealmBridge", RealmBridge.class, NameFactory.GERONIMO_SERVICE);
infoBuilder.addReference("TransactionContextManager", TransactionContextManager.class, NameFactory.JTA_RESOURCE);
infoBuilder.setConstructor(new String[]{
"transactionSupport",
"pooling",
- "RealmBridge",
+ "containerManagedSecurity",
"ConnectionTracker",
"TransactionContextManager",
"objectName",
Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java?rev=233130&r1=233129&r2=233130&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java Tue Aug 16 23:46:06 2005
@@ -26,12 +26,10 @@
import net.sf.cglib.proxy.Callback;
import net.sf.cglib.proxy.Enhancer;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.geronimo.connector.ConnectorMethodInterceptor;
import org.apache.geronimo.connector.ResourceAdapterWrapper;
-import org.apache.geronimo.connector.outbound.security.ManagedConnectionFactoryListener;
import org.apache.geronimo.gbean.DynamicGBean;
import org.apache.geronimo.gbean.DynamicGBeanDelegate;
import org.apache.geronimo.gbean.GBeanLifecycle;
@@ -60,7 +58,6 @@
private ResourceAdapterWrapper resourceAdapterWrapper;
private ConnectionManagerContainer connectionManagerContainer;
- private ManagedConnectionFactoryListener managedConnectionFactoryListener;
private ManagedConnectionFactory managedConnectionFactory;
@@ -101,7 +98,6 @@
String globalJNDIName,
ResourceAdapterWrapper resourceAdapterWrapper,
ConnectionManagerContainer connectionManagerContainer,
- ManagedConnectionFactoryListener managedConnectionFactoryListener,
Kernel kernel,
String objectName,
ClassLoader cl) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
@@ -138,7 +134,6 @@
managedConnectionFactory = (ManagedConnectionFactory) clazz.newInstance();
delegate = new DynamicGBeanDelegate();
delegate.addAll(managedConnectionFactory);
- this.managedConnectionFactoryListener = managedConnectionFactoryListener;
this.kernel = kernel;
this.objectName = objectName;
@@ -198,10 +193,6 @@
registered = true;
log.debug("Registered managedConnectionFactory with ResourceAdapter " + resourceAdapterWrapper.toString());
}
- //set up login if present
- if (managedConnectionFactoryListener != null) {
- managedConnectionFactoryListener.setManagedConnectionFactory(managedConnectionFactory);
- }
//create a new ConnectionFactory
connectionFactory = connectionManagerContainer.createConnectionFactory(managedConnectionFactory);
@@ -235,10 +226,6 @@
if (interceptor != null) {
interceptor.setInternalProxy(null);
}
- //tear down login if present
- if (managedConnectionFactoryListener != null) {
- managedConnectionFactoryListener.setManagedConnectionFactory(null);
- }
connectionFactory = null;
if (globalJNDIName != null) {
try {
@@ -288,6 +275,10 @@
public Object $getConnectionFactory() {
return connectionFactory;
+ }
+
+ public ManagedConnectionFactory $getManagedConnectionFactory() {
+ return managedConnectionFactory;
}
//ResourceManager implementation
Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperGBean.java?rev=233130&r1=233129&r2=233130&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperGBean.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperGBean.java Tue Aug 16 23:46:06 2005
@@ -17,7 +17,6 @@
package org.apache.geronimo.connector.outbound;
import org.apache.geronimo.connector.ResourceAdapterWrapper;
-import org.apache.geronimo.connector.outbound.security.ManagedConnectionFactoryListener;
import org.apache.geronimo.gbean.GBeanInfo;
import org.apache.geronimo.gbean.GBeanInfoBuilder;
import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
@@ -25,7 +24,7 @@
import org.apache.geronimo.transaction.manager.ResourceManager;
/**
- *
+ *
* @version $Revision$
*/
public class ManagedConnectionFactoryWrapperGBean {
@@ -48,12 +47,12 @@
infoFactory.addOperation("$getResource");
infoFactory.addOperation("$getConnectionFactory");
+ infoFactory.addOperation("$getManagedConnectionFactory");
infoFactory.addInterface(ResourceManager.class);
infoFactory.addReference("ResourceAdapterWrapper", ResourceAdapterWrapper.class, NameFactory.RESOURCE_ADAPTER);
infoFactory.addReference("ConnectionManagerContainer", ConnectionManagerContainer.class, NameFactory.JCA_CONNECTION_MANAGER);
- infoFactory.addReference("ManagedConnectionFactoryListener", ManagedConnectionFactoryListener.class, NameFactory.SECURITY_REALM);
infoFactory.setConstructor(new String[]{
"managedConnectionFactoryClass",
@@ -65,7 +64,6 @@
"globalJNDIName",
"ResourceAdapterWrapper",
"ConnectionManagerContainer",
- "ManagedConnectionFactoryListener",
"kernel",
"objectName",
"classLoader"});
Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/SubjectInterceptor.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/SubjectInterceptor.java?rev=233130&r1=233129&r2=233130&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/SubjectInterceptor.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/SubjectInterceptor.java Tue Aug 16 23:46:06 2005
@@ -20,10 +20,8 @@
import javax.resource.ResourceException;
import javax.resource.spi.ApplicationServerInternalException;
import javax.security.auth.Subject;
-import javax.security.auth.login.LoginException;
import org.apache.geronimo.security.ContextManager;
-import org.apache.geronimo.security.bridge.RealmBridge;
/**
* SubjectInterceptor.java
@@ -36,23 +34,17 @@
public class SubjectInterceptor implements ConnectionInterceptor {
private final ConnectionInterceptor next;
- private final RealmBridge realmBridge;
- public SubjectInterceptor(
- final ConnectionInterceptor next,
- final RealmBridge realmBridge) {
+ public SubjectInterceptor(final ConnectionInterceptor next) {
this.next = next;
- this.realmBridge = realmBridge;
}
public void getConnection(ConnectionInfo connectionInfo) throws ResourceException {
Subject currentSubject = null;
if (!connectionInfo.isApplicationManagedSecurity()) {
try {
- currentSubject = realmBridge.mapSubject(ContextManager.getCurrentCaller());
+ currentSubject = ContextManager.getCurrentCaller();
} catch (SecurityException e) {
- throw new ResourceException("Can not obtain Subject for login", e);
- } catch (LoginException e) {
throw new ResourceException("Can not obtain Subject for login", e);
}
assert currentSubject != null;
Copied: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/security/CallerIdentityPasswordCredentialLoginModule.java (from r232767, geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialLoginModule.java)
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/security/CallerIdentityPasswordCredentialLoginModule.java?p2=geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/security/CallerIdentityPasswordCredentialLoginModule.java&p1=geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialLoginModule.java&r1=232767&r2=233130&rev=233130&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialLoginModule.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/security/CallerIdentityPasswordCredentialLoginModule.java Tue Aug 16 23:46:06 2005
@@ -21,6 +21,7 @@
import java.util.Map;
import javax.resource.spi.security.PasswordCredential;
+import javax.resource.spi.ManagedConnectionFactory;
import javax.security.auth.Subject;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
@@ -36,12 +37,12 @@
* @version $Rev$ $Date$
*
* */
-public class PasswordCredentialLoginModule implements LoginModule {
+public class CallerIdentityPasswordCredentialLoginModule implements LoginModule {
private Subject subject;
private CallbackHandler callbackHandler;
- private PasswordCredentialRealm passwordCredentialRealm;
+ private ManagedConnectionFactory managedConnectionFactory;
private String resourcePrincipalName;
private String userName;
@@ -51,21 +52,20 @@
Map sharedState, Map options) {
this.subject = subject;
this.callbackHandler = callbackHandler;
- passwordCredentialRealm = (PasswordCredentialRealm) options.get(PasswordCredentialRealm.REALM_INSTANCE);
- if (passwordCredentialRealm == null) {
- throw new IllegalArgumentException("No realm supplied in options");
+ managedConnectionFactory = (ManagedConnectionFactory) options.get(PasswordCredentialLoginModuleWrapper.MANAGED_CONNECTION_FACTORY_OPTION);
+ if (managedConnectionFactory == null) {
+ throw new IllegalArgumentException("No ManagedConnectionFactory supplied in options");
}
}
public boolean login() throws LoginException {
- if (passwordCredentialRealm == null || passwordCredentialRealm.managedConnectionFactory == null) {
+ if (managedConnectionFactory == null) {
return false;
}
- Callback[] callbacks = new Callback[3];
+ Callback[] callbacks = new Callback[2];
- callbacks[0] = new NameCallback("Resource Principal");
- callbacks[1] = new NameCallback("User name");
- callbacks[2] = new PasswordCallback("Password", false);
+ callbacks[0] = new NameCallback("User name");
+ callbacks[1] = new PasswordCallback("Password", false);
try {
callbackHandler.handle(callbacks);
} catch (IOException ioe) {
@@ -74,15 +74,15 @@
throw (LoginException) new LoginException().initCause(uce);
}
resourcePrincipalName = ((NameCallback) callbacks[0]).getName();
- userName = ((NameCallback) callbacks[1]).getName();
- password = ((PasswordCallback) callbacks[2]).getPassword();
+ userName = ((NameCallback) callbacks[0]).getName();
+ password = ((PasswordCallback) callbacks[1]).getPassword();
return resourcePrincipalName != null && userName != null && password != null;
}
public boolean commit() throws LoginException {
subject.getPrincipals().add(new ResourcePrincipal(resourcePrincipalName));
PasswordCredential passwordCredential = new PasswordCredential(userName, password);
- passwordCredential.setManagedConnectionFactory(passwordCredentialRealm.getManagedConnectionFactory());
+ passwordCredential.setManagedConnectionFactory(managedConnectionFactory);
subject.getPrivateCredentials().add(passwordCredential);
return true;
}
Added: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialLoginModuleWrapper.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialLoginModuleWrapper.java?rev=233130&view=auto
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialLoginModuleWrapper.java (added)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialLoginModuleWrapper.java Tue Aug 16 23:46:06 2005
@@ -0,0 +1,37 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.connector.outbound.security;
+
+import java.util.Properties;
+import javax.resource.spi.ManagedConnectionFactory;
+
+import org.apache.geronimo.security.jaas.LoginModuleGBean;
+import org.apache.geronimo.connector.outbound.ManagedConnectionFactoryWrapper;
+
+/**
+ * @version $Rev: $ $Date: $
+ */
+public class PasswordCredentialLoginModuleWrapper extends LoginModuleGBean {
+ public static final String MANAGED_CONNECTION_FACTORY_OPTION = "geronimo.managedconnectionfactory.option";
+
+ public void setManagedConnectionFactoryWrapper(ManagedConnectionFactoryWrapper managedConnectionFactoryWrapper) {
+ ManagedConnectionFactory managedConnectionFactory = managedConnectionFactoryWrapper.$getManagedConnectionFactory();
+ Properties options = getOptions();
+ options.put(MANAGED_CONNECTION_FACTORY_OPTION, managedConnectionFactory);
+ }
+
+}
Added: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialLoginModuleWrapperGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialLoginModuleWrapperGBean.java?rev=233130&view=auto
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialLoginModuleWrapperGBean.java (added)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialLoginModuleWrapperGBean.java Tue Aug 16 23:46:06 2005
@@ -0,0 +1,44 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.connector.outbound.security;
+
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.security.jaas.LoginModuleGBean;
+import org.apache.geronimo.connector.outbound.ManagedConnectionFactoryWrapper;
+
+/**
+ * @version $Rev: $ $Date: $
+ */
+public class PasswordCredentialLoginModuleWrapperGBean {
+
+ private static final GBeanInfo GBEAN_INFO;
+
+ static {
+ GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(PasswordCredentialLoginModuleWrapper.class, LoginModuleGBean.GBEAN_INFO, NameFactory.LOGIN_MODULE);
+
+ infoFactory.addReference("ManagedConnectionFactoryWrapper", ManagedConnectionFactoryWrapper.class, NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
+
+ GBEAN_INFO = infoFactory.getBeanInfo();
+ }
+
+ public static GBeanInfo getGBeanInfo() {
+ return GBEAN_INFO;
+ }
+
+}
Modified: geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionInterceptorTestUtils.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionInterceptorTestUtils.java?rev=233130&r1=233129&r2=233130&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionInterceptorTestUtils.java (original)
+++ geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionInterceptorTestUtils.java Tue Aug 16 23:46:06 2005
@@ -20,7 +20,6 @@
import java.io.PrintWriter;
import java.security.Principal;
import java.util.Set;
-
import javax.resource.ResourceException;
import javax.resource.spi.ConnectionEventListener;
import javax.resource.spi.ConnectionRequestInfo;
@@ -32,7 +31,6 @@
import javax.transaction.xa.XAResource;
import junit.framework.TestCase;
-import org.apache.geronimo.security.bridge.RealmBridge;
/**
*
@@ -40,7 +38,7 @@
* @version $Rev$ $Date$
*
* */
-public class ConnectionInterceptorTestUtils extends TestCase implements RealmBridge, ConnectionInterceptor {
+public class ConnectionInterceptorTestUtils extends TestCase implements ConnectionInterceptor {
protected Subject subject;
protected ConnectionInfo obtainedConnectionInfo;
protected ConnectionInfo returnedConnectionInfo;
@@ -57,11 +55,6 @@
}
public void testNothing() throws Exception {
- }
-
- //RealmBridge implementation
- public Subject mapSubject(Subject sourceSubject) {
- return subject;
}
//ConnectorInterceptor implementation
Modified: geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerStressTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerStressTest.java?rev=233130&r1=233129&r2=233130&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerStressTest.java (original)
+++ geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerStressTest.java Tue Aug 16 23:46:06 2005
@@ -34,7 +34,7 @@
private static final Log log = LogFactory.getLog(ConnectionManagerStressTest.class);
protected int repeatCount = 200;
- protected int threadCount = 100;
+ protected int threadCount = 10;
private Object startBarrier = new Object();
private Object stopBarrier = new Object();
private int startedThreads = 0;
Modified: geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerTestUtils.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerTestUtils.java?rev=233130&r1=233129&r2=233130&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerTestUtils.java (original)
+++ geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerTestUtils.java Tue Aug 16 23:46:06 2005
@@ -34,7 +34,6 @@
import org.apache.geronimo.connector.outbound.connectiontracking.DefaultComponentInterceptor;
import org.apache.geronimo.connector.outbound.connectiontracking.DefaultInterceptor;
import org.apache.geronimo.security.ContextManager;
-import org.apache.geronimo.security.bridge.RealmBridge;
import org.apache.geronimo.transaction.DefaultInstanceContext;
import org.apache.geronimo.transaction.InstanceContext;
import org.apache.geronimo.transaction.context.TransactionContextManager;
@@ -47,7 +46,7 @@
* @version $Rev$ $Date$
*
* */
-public class ConnectionManagerTestUtils extends TestCase implements DefaultInterceptor, RealmBridge {
+public class ConnectionManagerTestUtils extends TestCase implements DefaultInterceptor {
protected boolean useTransactionCaching = true;
protected boolean useLocalTransactions = false;
protected boolean useThreadCaching = false;
@@ -63,7 +62,6 @@
private boolean selectOneNoMatch = false;
protected String name = "testCF";
//dependencies
- protected RealmBridge realmBridge = this;
protected ConnectionTrackingCoordinator connectionTrackingCoordinator;
protected TransactionContextManager transactionContextManager;
protected AbstractConnectionManager connectionManagerDeployment;
@@ -78,6 +76,7 @@
protected UserTransactionImpl userTransaction;
protected TransactionSupport transactionSupport = new XATransactions(useTransactionCaching, useThreadCaching);
protected PoolingSupport poolingSupport = new PartitionedPool(maxSize, minSize, blockingTimeout, idleTimeoutMinutes, matchOne, matchAll, selectOneNoMatch, useConnectionRequestInfo, useSubject);
+ protected boolean containerManagedSecurity = true;
protected DefaultInterceptor mockComponent = new DefaultInterceptor() {
public Object invoke(InstanceContext newInstanceContext) throws Throwable {
@@ -99,7 +98,7 @@
connectionManagerDeployment = new GenericConnectionManager(
transactionSupport,
poolingSupport,
- realmBridge,
+ containerManagedSecurity,
connectionTrackingCoordinator,
transactionContextManager,
name,
@@ -116,11 +115,6 @@
connectionManagerDeployment = null;
connectionFactory = null;
defaultComponentContext = null;
- }
-
-
- public Subject mapSubject(Subject sourceSubject) {
- return subject;
}
public Object invoke(InstanceContext newInstanceContext) throws Throwable {
Modified: geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/SubjectInterceptorTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/SubjectInterceptorTest.java?rev=233130&r1=233129&r2=233130&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/SubjectInterceptorTest.java (original)
+++ geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/SubjectInterceptorTest.java Tue Aug 16 23:46:06 2005
@@ -20,6 +20,8 @@
import javax.security.auth.Subject;
import javax.resource.ResourceException;
+import org.apache.geronimo.security.ContextManager;
+
/**
*
*
@@ -32,7 +34,7 @@
protected void setUp() throws Exception {
super.setUp();
- subjectInterceptor = new SubjectInterceptor(this, this);
+ subjectInterceptor = new SubjectInterceptor(this);
}
protected void tearDown() throws Exception {
@@ -42,6 +44,7 @@
public void testGetConnection() throws Exception {
subject = new Subject();
+ ContextManager.setCurrentCaller(subject);
ConnectionInfo connectionInfo = makeConnectionInfo();
ManagedConnectionInfo managedConnectionInfo = connectionInfo.getManagedConnectionInfo();
subjectInterceptor.getConnection(connectionInfo);
@@ -70,12 +73,14 @@
public void testEnterWithChangedSubject() throws Exception {
makeSubject("foo");
+ ContextManager.setCurrentCaller(subject);
ConnectionInfo connectionInfo = makeConnectionInfo();
managedConnection = new TestPlainManagedConnection();
subjectInterceptor.getConnection(connectionInfo);
//reset our test indicator
obtainedConnectionInfo = null;
makeSubject("bar");
+ ContextManager.setCurrentCaller(subject);
subjectInterceptor.getConnection(connectionInfo);
//expect re-association
assertTrue("Expected connection asked for", obtainedConnectionInfo != null);
@@ -98,6 +103,7 @@
public void testUnshareablePreventsReAssociation() throws Exception {
makeSubject("foo");
+ ContextManager.setCurrentCaller(subject);
ConnectionInfo connectionInfo = makeConnectionInfo();
connectionInfo.setUnshareable(true);
managedConnection = new TestPlainManagedConnection();
@@ -105,6 +111,7 @@
//reset our test indicator
obtainedConnectionInfo = null;
makeSubject("bar");
+ ContextManager.setCurrentCaller(subject);
try {
subjectInterceptor.getConnection(connectionInfo);
fail("Reassociating should fail on an unshareable connection");
Modified: geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/AbstractTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/AbstractTest.java?rev=233130&r1=233129&r2=233130&view=diff
==============================================================================
--- geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/AbstractTest.java (original)
+++ geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/AbstractTest.java Tue Aug 16 23:46:06 2005
@@ -33,7 +33,6 @@
import org.apache.geronimo.gbean.GBeanData;
import org.apache.geronimo.kernel.KernelFactory;
import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.security.bridge.TestLoginModule;
import org.apache.geronimo.security.jaas.JaasLoginService;
import org.apache.geronimo.security.jaas.LoginModuleGBean;
import org.apache.geronimo.security.jaas.JaasLoginModuleUse;
@@ -50,6 +49,7 @@
protected ObjectName testLoginModule;
protected ObjectName testRealm;
protected ObjectName serverStub;
+ private static final String REALM_NAME = "test-realm";
protected void setUp() throws Exception {
kernel = KernelFactory.newInstance().createKernel("test.kernel");
@@ -80,9 +80,9 @@
gbean.setReferencePattern("LoginModule", testLoginModule);
kernel.loadGBean(gbean, JaasLoginModuleUse.class.getClassLoader());
- testRealm = new ObjectName("geronimo.security:type=SecurityRealm,realm="+TestLoginModule.REALM_NAME);
+ testRealm = new ObjectName("geronimo.security:type=SecurityRealm,realm=" + REALM_NAME);
gbean = new GBeanData(testRealm, GenericSecurityRealm.getGBeanInfo());
- gbean.setAttribute("realmName", TestLoginModule.REALM_NAME);
+ gbean.setAttribute("realmName", REALM_NAME);
Properties props = new Properties();
// props.setProperty("LoginModule.1.REQUIRED","geronimo.security:type=LoginModule,name=TestModule");
// gbean.setAttribute("loginModuleConfiguration", props);