<?xml version="1.0" encoding="iso-8859-1"?>

<rdf:RDF 
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns="http://purl.org/rss/1.0/"
>
		
		
		
	<channel rdf:about="http://www.richinternet.de/blog/index.cfm">
	<title>Richinternet Blog</title>
	<description>The Rich Internet Dev Blog</description>
	<link>http://www.richinternet.de/blog/index.cfm</link>
	
	<items>
		<rdf:Seq>
			
			<rdf:li rdf:resource="http://www.richinternet.de/blog/index.cfm?mode=entry&amp;entry=EC29C56F-036B-3DC2-C4546079F9C92998" />
			
		</rdf:Seq>
	</items>
	
	</channel>
		
		
		
		
		
		
		
		
		
		
		
  	<item rdf:about="http://www.richinternet.de/blog/index.cfm?mode=entry&amp;entry=EC29C56F-036B-3DC2-C4546079F9C92998">
	<title>Creating Remoting channels at runtime in ColdFusion</title>
	<description>&lt;p&gt;In a recent project I had to dynamically create a Flex Remoting endpoint (Channels) at runtime in the embedded BlazeDS of ColdFusion (this was due to the fact that we did not wanted the customer to mess around with the services-config.xml file).&lt;/p&gt;
&lt;p&gt;By default, the &quot;ColdFusion&quot; Remoting destination only uses a non-secure AMFChannel but we wanted to use the SecureAMFChannel on that destination as well. Usually, you&apos;d need to edit the remoting-config.xml file, add the &quot;my-cfamf-secure&quot; channel to the list of channels for the &quot;ColdFusion&quot; destination and then restart the server. With runtime channel configuration, you can just add (or even remove) channels at runtime with no server restart. Actually, you can do anything you want as long as the BlazeDS API supports it.&lt;/p&gt;
&lt;p&gt;In my case, I use the onApplicationStart methode of the Application.cfc to call the configureChannels method which will add the existing &quot;my-cfamf-secure&quot; channel to the &quot;ColdFusion&quot; endpoint in case it has not been done already:&lt;/p&gt;
&lt;div class=&quot;code&quot;&gt;&lt;FONT COLOR=MAROON&gt;&amp;lt;cffunction name=&lt;FONT COLOR=BLUE&gt;&quot;configureChannels&quot;&lt;/FONT&gt; returntype=&lt;FONT COLOR=BLUE&gt;&quot;void&quot;&lt;/FONT&gt; access=&lt;FONT COLOR=BLUE&gt;&quot;private&quot;&lt;/FONT&gt;&amp;gt;&lt;/FONT&gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT COLOR=MAROON&gt;&amp;lt;cfscript&amp;gt;&lt;/FONT&gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;var cls = createObject(&lt;FONT COLOR=BLUE&gt;&quot;java&quot;&lt;/FONT&gt;, &lt;FONT COLOR=BLUE&gt;&quot;flex.messaging.MessageBroker&quot;&lt;/FONT&gt;);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;var broker = cls.getMessageBroker(javacast(&lt;FONT COLOR=BLUE&gt;&quot;null&quot;&lt;/FONT&gt;, &lt;FONT COLOR=BLUE&gt;&quot;&quot;&lt;/FONT&gt;));&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;var service = broker.getService(&lt;FONT COLOR=BLUE&gt;&quot;remoting-service&quot;&lt;/FONT&gt;);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;if (service.getDefaultChannels().size() == 1)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;service.addDefaultChannel(&lt;FONT COLOR=BLUE&gt;&quot;my-cfamf-secure&quot;&lt;/FONT&gt;);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;destination = service.getDestination(&lt;FONT COLOR=BLUE&gt;&quot;ColdFusion&quot;&lt;/FONT&gt;);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;if (destination.getChannels().size() == 1)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;destination.addChannel(&lt;FONT COLOR=BLUE&gt;&quot;my-cfamf-secure&quot;&lt;/FONT&gt;);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT COLOR=MAROON&gt;&amp;lt;/cfscript&amp;gt;&lt;/FONT&gt;&lt;br&gt;
&lt;FONT COLOR=MAROON&gt;&amp;lt;/cffunction&amp;gt;&lt;/FONT&gt;&lt;/div&gt;
&lt;p&gt;That&apos;s it.&lt;/p&gt;
&lt;p&gt;Dirk.&lt;/p&gt;</description>
	<link>http://www.richinternet.de/blog/index.cfm?mode=entry&amp;entry=EC29C56F-036B-3DC2-C4546079F9C92998</link>
	<dc:date>2011-03-25T09:38:03-02:00</dc:date>
	<dc:subject>ColdFusion,Flex</dc:subject>
	</item>
		
	 	
		</rdf:RDF>
	

