[ 
https://issues.apache.org/jira/browse/AMQNET-306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12980781#action_12980781
 ] 

Jim Gomes commented on AMQNET-306:
----------------------------------

Another potential solution for the run-time reflection discovery option would 
be to add support for custom attributes that would mark a transport 
implementation function.  The following pseudo-code demonstrates what the 
implementation would look like:

{code:title=CustomTransport.cs|borderStyle=solid}
[NMSTransport("transportname")]
public void MyCustomTransport()
{
}
{code}

The transport factory loader could look for the custom {{NMSTransport}} 
attribute on member functions, and then match the named transport field to find 
the correct implementation to call.  This allows self-documenting code (the 
attribute declares its purpose), and lessens the dependency on function naming 
conventions.

> Provide a means of adding new Transports to the TransportFactory either et 
> runtime or via some other mechanism
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: AMQNET-306
>                 URL: https://issues.apache.org/jira/browse/AMQNET-306
>             Project: ActiveMQ .Net
>          Issue Type: Improvement
>          Components: ActiveMQ
>    Affects Versions: 1.5.0
>            Reporter: Timothy Bish
>            Assignee: Timothy Bish
>            Priority: Minor
>             Fix For: 1.5.0
>
>
> Currently the only way to add new Transports to the 
> Apache.NMS.ActiveMQ.Transport.TransportFactory is to hard code the mapping 
> between the uri scheme and the ITransportFactory that is used to create 
> transports of the scheme type.  This makes it difficult to add new transports 
> or to inject new ones in the tests library for instance.  It would be nice if 
> there was a way to register new TransportFactory mappings or even better to 
> have the TransportFactory dynamically discover them.
> One option is to just add a RegisterTransportFactory method that takes a 
> scheme and the name or type of a class that can later be created when a new 
> ConnectionFactory is instantiated.  
> Another options might be to embed the information needed to map a scheme to 
> an ITransportFactory in the Resources of an assenbly and have the 
> TransportFactory enumerate the loaded assembles to attempt to find that 
> information.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to