Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
joram
joram
Commits
893ca98c
Commit
893ca98c
authored
Jun 22, 2010
by
Nicolas Tachker
Browse files
maven migration.
parent
a2861e6a
Changes
546
Expand all
Hide whitespace changes
Inline
Side-by-side
joram/joram/client/jca/pom.xml
0 → 100644
View file @
893ca98c
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
org.objectweb.joram
</groupId>
<artifactId>
joram-client-jca
</artifactId>
<packaging>
bundle
</packaging>
<name>
JORAM :: joram :: client :: JCA 1.5 connector
</name>
<description>
Builds the Joram connector project.
</description>
<parent>
<groupId>
org.objectweb.joram
</groupId>
<artifactId>
joram-client
</artifactId>
<version>
5.3.2.53-SNAPSHOT
</version>
</parent>
<build>
<plugins>
<plugin>
<groupId>
org.apache.felix
</groupId>
<artifactId>
maven-bundle-plugin
</artifactId>
<extensions>
true
</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>
${pom.artifactId}
</Bundle-SymbolicName>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>
org.apache.geronimo.specs
</groupId>
<artifactId>
geronimo-jms_1.1_spec
</artifactId>
</dependency>
<dependency>
<groupId>
org.ow2.spec.ee
</groupId>
<artifactId>
ow2-connector-1.5-spec
</artifactId>
</dependency>
<dependency>
<groupId>
org.objectweb.joram
</groupId>
<artifactId>
joram-client-jms
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.objectweb.joram
</groupId>
<artifactId>
joram-mom-core
</artifactId>
<version>
${project.version}
</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
joram/joram/client/jca/src/main/java/org/objectweb/joram/client/connector/ActivationSpecImpl.java
0 → 100644
View file @
893ca98c
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2004 - Bull SA
* Copyright (C) 2008 - ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): Frederic Maistre (Bull SA)
* Contributor(s): Nicolas Tachker (Bull SA)
*/
package
org.objectweb.joram.client.connector
;
import
javax.resource.ResourceException
;
import
javax.resource.spi.IllegalStateException
;
import
javax.resource.spi.InvalidPropertyException
;
import
javax.resource.spi.ResourceAdapter
;
import
org.objectweb.joram.shared.security.SimpleIdentity
;
import
org.objectweb.util.monolog.api.BasicLevel
;
/**
* An <code>ActivationSpecImpl</code> instance holds configuration information
* related to an endpoint deployment.
*/
public
class
ActivationSpecImpl
implements
javax
.
resource
.
spi
.
ActivationSpec
,
javax
.
resource
.
spi
.
ResourceAdapterAssociation
,
java
.
io
.
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
/**
* Value for the property <code>acknowledgeMode</code>
* defined in the MDB deployment descriptor.
*/
public
static
final
String
AUTO_ACKNOWLEDGE
=
"Auto-acknowledge"
;
/**
* Value for the property <code>acknowledgeMode</code>
* defined in the MDB deployment descriptor.
*/
public
static
final
String
DUPS_OK_ACKNOWLEDGE
=
"Dups-ok-acknowledge"
;
/** The type of the destination to get messages from. */
private
String
destinationType
;
/** The name of the destination to get messages from. */
private
String
destination
;
/** User identification. */
private
String
userName
=
"anonymous"
;
/** User password. */
private
String
password
=
"anonymous"
;
/** identity class name. */
String
identityClass
=
SimpleIdentity
.
class
.
getName
();
/** Message selector. */
private
String
messageSelector
=
null
;
/** Subscription durability. */
private
String
subscriptionDurability
=
null
;
/** Durable subscription name, if any. */
private
String
subscriptionName
;
/** Acknowledgement mode. */
private
String
acknowledgeMode
=
AUTO_ACKNOWLEDGE
;
/** Maximum number of work instances to be submitted (0 for infinite). */
private
String
maxNumberOfWorks
=
"0"
;
/**
* The maximum number of messages that can be assigned
* to a server session at one time
* Default is 10.
*/
private
String
maxMessages
=
"10"
;
/** Resource adapter central authority. */
private
transient
ResourceAdapter
ra
=
null
;
/**
* Constructs an <code>ActivationSpecImpl</code> instance.
*/
public
ActivationSpecImpl
()
{}
/**
* Checks if the configuration information is valid.
*
* @exception InvalidPropertyException If a parameter is missing, incorrect,
* or not consistent with other
* parameters.
*/
public
void
validate
()
throws
InvalidPropertyException
{
if
(
destinationType
!=
null
&&
!
destinationType
.
equals
(
"javax.jms.Queue"
)
&&
!
destinationType
.
equals
(
"javax.jms.Topic"
))
throw
new
InvalidPropertyException
(
"Invalid destination type: "
+
destinationType
);
if
(
destination
==
null
)
throw
new
InvalidPropertyException
(
"Missing destination property."
);
if
(
acknowledgeMode
!=
null
&&
!
acknowledgeMode
.
equals
(
AUTO_ACKNOWLEDGE
)
&&
!
acknowledgeMode
.
equals
(
DUPS_OK_ACKNOWLEDGE
))
throw
new
InvalidPropertyException
(
"Invalid acknowledge mode: "
+
acknowledgeMode
);
if
(
subscriptionDurability
!=
null
)
{
if
(
subscriptionDurability
.
equals
(
"Durable"
)
&&
destinationType
.
equals
(
"javax.jms.Queue"
))
throw
new
InvalidPropertyException
(
"Can't set a durable subscription "
+
"on a JMS queue."
);
if
(
subscriptionDurability
.
equals
(
"Durable"
)
&&
subscriptionName
==
null
)
throw
new
InvalidPropertyException
(
"Missing durable subscription name."
);
}
}
/** Sets the resource adapter central authority. */
public
void
setResourceAdapter
(
ResourceAdapter
ra
)
throws
ResourceException
{
if
(
AdapterTracing
.
dbgAdapter
.
isLoggable
(
BasicLevel
.
DEBUG
))
AdapterTracing
.
dbgAdapter
.
log
(
BasicLevel
.
DEBUG
,
this
+
" setResourceAdapter("
+
ra
+
")"
);
if
(
this
.
ra
!=
null
)
throw
new
IllegalStateException
(
"Can not change resource adapter"
+
" association."
);
if
(!
(
ra
instanceof
JoramAdapter
))
throw
new
ResourceException
(
"Provided resource adapter is not a JORAM "
+
"resource adapter: "
+
ra
.
getClass
().
getName
());
this
.
ra
=
ra
;
}
/** Returns the resource adapter central authority instance. */
public
ResourceAdapter
getResourceAdapter
()
{
if
(
AdapterTracing
.
dbgAdapter
.
isLoggable
(
BasicLevel
.
DEBUG
))
AdapterTracing
.
dbgAdapter
.
log
(
BasicLevel
.
DEBUG
,
this
+
" getResourceAdapter = "
+
ra
);
return
ra
;
}
// ------------------------------------------
// --- JavaBean setter and getter methods ---
// ------------------------------------------
/**
* Sets the destination type (either "javax.jms.Queue" or
* "javax.jms.Topic").
*/
public
void
setDestinationType
(
String
destinationType
)
{
this
.
destinationType
=
destinationType
;
}
/** Sets the destination name. */
public
void
setDestination
(
String
destination
)
{
this
.
destination
=
destination
;
}
/** Sets the user identification. */
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
/** Sets the user password. */
public
void
setPassword
(
String
password
)
{
this
.
password
=
password
;
}
/** set the identity class name. */
public
void
setIdentityClass
(
String
identityClass
)
{
this
.
identityClass
=
identityClass
;
}
/** Sets the message selector. */
public
void
setMessageSelector
(
String
messageSelector
)
{
this
.
messageSelector
=
messageSelector
;
}
/** Sets the durability of the subscription. */
public
void
setSubscriptionDurability
(
String
subscriptionDurability
)
{
this
.
subscriptionDurability
=
subscriptionDurability
;
}
/** Sets the name of the durable subscription. */
public
void
setSubscriptionName
(
String
subscriptionName
)
{
this
.
subscriptionName
=
subscriptionName
;
}
/** Sets the acknowledgement mode. */
public
void
setAcknowledgeMode
(
String
acknowledgeMode
)
{
this
.
acknowledgeMode
=
acknowledgeMode
;
}
/** Sets the maximum number of work instances to be submitted. */
public
void
setMaxNumberOfWorks
(
String
maxNumberOfWorks
)
{
this
.
maxNumberOfWorks
=
maxNumberOfWorks
;
}
public
void
setMaxMessages
(
String
maxMessages
)
{
this
.
maxMessages
=
maxMessages
;
}
/** Returns the destination type. */
public
String
getDestinationType
()
{
return
destinationType
;
}
/** Returns the destination name. */
public
String
getDestination
()
{
return
destination
;
}
/** Returns the user identification. */
public
String
getUserName
()
{
return
userName
;
}
/** Returns the user password. */
public
String
getPassword
()
{
return
password
;
}
/** Returns the identity class name. */
public
String
getIdentityClass
()
{
return
identityClass
;
}
/** Returns the message selector. */
public
String
getMessageSelector
()
{
return
messageSelector
;
}
/** Returns the subscription durabbility. */
public
String
getSubscriptionDurability
()
{
return
subscriptionDurability
;
}
/** Returns the name of the durable subscription. */
public
String
getSubscriptionName
()
{
return
subscriptionName
;
}
/** Returns the acknowledgement mode. */
public
String
getAcknowledgeMode
()
{
return
acknowledgeMode
;
}
/** Returns the maximum number of work instances to be submitted. */
public
String
getMaxNumberOfWorks
()
{
return
maxNumberOfWorks
;
}
public
String
getMaxMessages
()
{
return
maxMessages
;
}
}
joram/joram/client/jca/src/main/java/org/objectweb/joram/client/connector/AdapterTracing.java
0 → 100644
View file @
893ca98c
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2004 - 2008 ScalAgent Distributed Technologies
* Copyright (C) 2004 - Bull SA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): Frederic Maistre (Bull SA)
* Contributor(s): Nicolas Tachker (ScalAgent D.T.)
*/
package
org.objectweb.joram.client.connector
;
import
fr.dyade.aaa.common.Debug
;
import
org.objectweb.util.monolog.api.Logger
;
/**
* Utility class for logging.
*/
public
class
AdapterTracing
{
public
static
Logger
dbgAdapter
=
null
;
static
{
dbgAdapter
=
Debug
.
getLogger
(
"org.objectweb.joram.client.connector.Adapter"
);
}
}
joram/joram/client/jca/src/main/java/org/objectweb/joram/client/connector/ConnectionRequest.java
0 → 100644
View file @
893ca98c
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2004 - Bull SA
* Copyright (C) 2008 - ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): Frederic Maistre (Bull SA)
* Contributor(s): Nicolas Tachker (Bull SA)
* ScalAgent Distributed Technologies
*/
package
org.objectweb.joram.client.connector
;
/**
* A <code>ConnectionRequest</code> instance wraps a user connection
* request for performing unified messaging.
*/
public
class
ConnectionRequest
implements
javax
.
resource
.
spi
.
ConnectionRequestInfo
{
/**
* Identification of the user requesting a connection to the
* underlying JORAM server.
*/
protected
String
userName
;
/**
* Password of the user requesting a connection to the
* underlying JORAM server.
*/
protected
String
password
;
/**
* identification class for user.
*/
protected
String
identityClass
;
/**
* Constructs a <code>ConnectionRequest</code> instance.
*
* @param userName Name of the user requesting a connection.
* @param password Password of the user requesting a connection.
* @param identityClass identity class name
*/
public
ConnectionRequest
(
String
userName
,
String
password
,
String
identityClass
)
{
this
.
userName
=
userName
;
this
.
password
=
password
;
this
.
identityClass
=
identityClass
;
}
/**
* Returns the identification of the user requesting a connection to the
* underlying JORAM server.
*/
public
String
getUserName
()
{
return
userName
;
}
/**
* Returns the password of the user requesting a connection to the
* underlying JORAM server.
*/
public
String
getPassword
()
{
return
password
;
}
/**
* @return identity class name.
*/
public
String
getIdentityClass
()
{
return
identityClass
;
}
/**
* Compares <code>ConnectionRequest</code> instances wrapped users
* identities.
*/
public
boolean
equals
(
Object
o
)
{
if
(!
(
o
instanceof
ConnectionRequest
))
return
false
;
ConnectionRequest
other
=
(
ConnectionRequest
)
o
;
return
this
.
getClass
().
equals
(
o
.
getClass
())
&&
other
.
getUserName
().
equals
(
userName
);
}
/** Returns a code based on the wrapped user identity. */
public
int
hashCode
()
{
return
(
"Unified:"
+
userName
).
hashCode
();
}
}
joram/joram/client/jca/src/main/java/org/objectweb/joram/client/connector/DefaultConnectionManager.java
0 → 100644
View file @
893ca98c
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2004 - 2008 ScalAgent Distributed Technologies
* Copyright (C) 2004 - Bull SA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): Frederic Maistre (Bull SA)
* Contributor(s): Nicolas Tachker (Bull SA)
* ScalAgent Distributed Technologies
*/
package
org.objectweb.joram.client.connector
;
import
javax.jms.ConnectionFactory
;
import
javax.jms.IllegalStateException
;
import
javax.jms.JMSException
;
import
javax.jms.JMSSecurityException
;
import
javax.jms.QueueConnectionFactory
;
import
javax.jms.TopicConnectionFactory
;
import
javax.resource.ResourceException
;
import
javax.resource.spi.CommException
;
import
javax.resource.spi.ConnectionRequestInfo
;
import
javax.resource.spi.ManagedConnectionFactory
;
import
javax.resource.spi.SecurityException
;
import
org.objectweb.joram.client.jms.admin.AbstractConnectionFactory
;
import
org.objectweb.joram.client.jms.tcp.QueueTcpConnectionFactory
;
import
org.objectweb.joram.client.jms.tcp.TcpConnectionFactory
;
import
org.objectweb.joram.client.jms.tcp.TopicTcpConnectionFactory
;
import
org.objectweb.util.monolog.api.BasicLevel
;
/**
* The <code>DefaultConnectionManager</code> class is the default connection
* manager provided with JORAM resource adapter, which intercepts connections
* requests coming from non managed client applications.
*/
public
class
DefaultConnectionManager
implements
javax
.
resource
.
spi
.
ConnectionManager
,
java
.
io
.
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
/**
* Static reference to the local <code>DefaultConnectionManager</code>
* instance.
*/
private
static
DefaultConnectionManager
ref
=
null
;
/**
* Creates a <code>DefaultConnectionManager</code> instance.
*/
public
DefaultConnectionManager
()
{}
/**
* Returns a <code>javax.jms.Connection</code> connection instance for