The Java EE 6 Tutorial, Volume I

Example 1: @Connector Annotation

The following deployment descriptor defines a connector:

<connector xmlns "http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/connector_1_6.xsd" 
version="1.6">
<description>Sample adapter using the JavaMail API</description>
<display-name>InboundResourceAdapter</display-name>
<icon></icon>
<vendor-name>Sun Microsystems, Inc</vendor-name>

<eis-type>MAIL</eis-type>
<resourceadapter-version>1.0</resourceadapter-version>
...
...
...
<authentication-mechanism>
	<authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
<credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
</authentication-mechanism>
<reauthentication-support>false</reauthentication-support>
...
...
</connector>

The equivalent metadata annotation is as follows:

@Connector(
description = "Sample adapter using the JavaMail API",
   displayName = "InboundResourceAdapter",
   vendorName = "Sun Microsystems, Inc.",
    eisType = "MAIL",
    version = "1.0",
   authMechanisms = {
                @AuthenticationMechanism(
          authMechanism = "BasicPassword",
credentialInterface = AuthenticationMechanism.CredentialInterface.PasswordCredential
                )
        }

/*
 // Since the following attribute values denote the default values of the annotation,
 // they need not be specified explicitly

 transactionSupport = TransactionSupport.TransactionSupportLevel.NoTransaction,
    reauthenticationSupport = false
*/
)

public class ResourceAdapterImpl 
implements ResourceAdapter, java.io.Serializable
{
...
...
}