org.mule.api.annotations
Annotation Type Connect


@Target(value=METHOD)
@Retention(value=SOURCE)
@Documented
public @interface Connect

This annotation marks a method inside an @Connector scope as the responsible for creating a connection. This method could have several parameters and them could contain annotations such as ConnectionKey or Password. It is guaranteed that this method will be called before calling any message processor.

There are two restrictions though.

  1. There can't be parameters with primitive types as int,bool,short, etc.

  2. The method's return type must be void


Optional Element Summary
 ConnectStrategy strategy
           Defines the strategy to be used when managing connections.
 

strategy

public abstract ConnectStrategy strategy

Defines the strategy to be used when managing connections. Two values are given out of the box.

  • ConnectStrategy.MULTIPLE_INSTANCES to be used when multiple connector instances can be used within the same key (like user name and password). This is intended for non thread safe environments.
  • ConnectStrategy.SINGLE_INSTANCE to be used when only a single instance can be used within the same key (like user name and password). It is important to notice that the service client used here must be thread safe
  • Default:
    org.mule.api.annotations.ConnectStrategy.MULTIPLE_INSTANCES


    Copyright © 2010–2014 MuleSoft, Inc.. All rights reserved.