anchor.diff:  		<cfelseif not bfUtils.defaultFactoryExists(bfScope)>
   			<cfset bfUtils.setDefaultFactory(bfScope,variables.beanFactory)/>
   		</cfif>
  -		
  +
   		<!--- first we need to build the advisor to search for pointcut matches --->
  -		<cfset methodPointcutAdvisor = 
  +		<cfset methodPointcutAdvisor =
   			   CreateObject('component','coldspring.aop.support.NamedMethodPointcut').init() />
   		<cfset methodPointcutAdvisor.setMappedNames(variables.remoteMethodNames) />
  -			   
  +
   		<!--- we'll need the flashMappingsInterceptor for later --->
   		<cfif StructKeyExists(variables,'flashUtilityService')>
   			<cfset flashMappingsInterceptor = CreateObject('component','coldspring.aop.FlashMappingsInterceptor').init() />
   			<cfset flashMappingsInterceptor.setFlashUtilityService(variables.flashUtilityService) />
   		</cfif>
  -		
  +
   		<!--- NEW --->
  -		<!--- first we need to build the advisor chain to search for 
  +		<!--- first we need to build the advisor chain to search for
   			  pointcut matches inside the methods selected as remote methods --->
   		<!--- <cfset buildAdvisorChain() /> --->
  -		
  +
   		<!--- now add the flashMappingsInterceptor above as the last around advice (if it was created) --->
   		<cfif isObject(flashMappingsInterceptor)>
   			<cfset addAdviceWithDefaultAdvisor(flashMappingsInterceptor) />
   		</cfif>
  -		<cfloop condition="structKeyExists(md,'extends')">
  -			<cfif structKeyExists(md,'extends')>
  -				<cfif Left(md.name, 34) neq "coldspring.aop.framework.tmp.bean_">
  -			
  -				<!--- now we'll loop through the target's methods and write remote methods for any matched ones --->
  -				<cfloop from="1" to="#arraylen(md.functions)#" index="functionIx">
  -					<cfset functionName = md.functions[functionIx].name />
  -					<cfif not ListFindNoCase('init', functionName) and not StructKeyExists(usedFunctions, functionName)>
  -					
  -						<cfset usedFunctions[functionName] = "" />
  -						<cfif methodPointcutAdvisor.matches(functionName)>
  -						
  -							<!--- this type of proxy will be limited to remote methods, so 
  -								  now we need to look for any advisors to add for this method --->
  -							<cfloop from="1" to="#ArrayLen(variables.advisorChain)#" index="advisorIx">
  -								<cfif variables.advisorChain[advisorIx].matches(functionName)>
  -									<!--- if we found a mathing pointcut in an advisor, make sure this method 
  -										  has an adviceChain started --->
  -									<cfif not StructKeyExists(methodAdviceChains, functionName)>
  -										<cfset methodAdviceChains[functionName] = 
  -											   CreateObject('component','coldspring.aop.AdviceChain').init() />
  -									</cfif>
  -									<cfset advice = variables.advisorChain[advisorIx].getAdvice() />
  -									<cfset methodAdviceChains[functionName].addAdvice(advice) />
  -								</cfif>
  -							</cfloop>
  -							
  -							<!--- now we need to generate a remote method --->
  -							<cfset functionString = functionString & 
  -								   variables.aopProxyUtils.createRemoteMethod(md.functions[functionIx], functionName, 'remote')  & Chr(10) & Chr(10) />
  -							
  +
  +		<!--- allow for '' remoteMethodNames --->
  +		<cfif Len(variables.remoteMethodNames)>
  +			<cfloop condition="structKeyExists(md,'extends')">
  +				<cfif structKeyExists(md,'extends')>
  +					<cfif Left(md.name, 34) neq "coldspring.aop.framework.tmp.bean_">
  +
  +					<!--- now we'll loop through the target's methods and write remote methods for any matched ones --->
  +					<cfloop from="1" to="#arraylen(md.functions)#" index="functionIx">
  +						<cfset functionName = md.functions[functionIx].name />
  +						<cfif not ListFindNoCase('init', functionName) and not StructKeyExists(usedFunctions, functionName)>
  +
  +							<cfset usedFunctions[functionName] = "" />
  +							<cfif methodPointcutAdvisor.matches(functionName)>
  +
  +								<cfset applyAdvisorChain(functionName, methodAdviceChains) />
  +
  +								<!--- now we need to generate a remote method --->
  +								<cfset functionString = functionString &
  +									   variables.aopProxyUtils.createRemoteMethod(md.functions[functionIx], functionName, 'remote')  & Chr(10) & Chr(10) />
  +
  +							</cfif>
   						</cfif>
  +					</cfloop>
  +
   					</cfif>
  -				</cfloop>
  -				
   				</cfif>
  +				<cfset md = md.extends />
  +			</cfloop>
  +		</cfif>
  +
  +		<!---
  +		this is where we create some methods that don't really exist,
  +		for use with onMissingMethod
  +		 --->
  +		<cfloop list="#variables.addMissingMethods#" index="functionName">
  +			<!--- make sure we didn't hit it already --->
  +			<cfif not ListFindNoCase('init', functionName) and not StructKeyExists(usedFunctions, functionName)>
  +				<cfset usedFunctions[functionName] = "" />
  +
  +				<cfset applyAdvisorChain(functionName, methodAdviceChains) />
  +
  +				<cfscript>
  +					//fake meta data
  +					md = StructNew();
  +					md.access = "public";
  +					md.returntype = "any";
  +					md.name = functionName;
  +					//who has output in a cfc... really?
  +					md.output="false";
  +					//no parameters, they get managed by the target
  +					md.parameters = ArrayNew(1);
  +				</cfscript>
  +
  +				<!--- now we need to generate a remote method --->
  +				<cfset functionString = functionString &
  +					   variables.aopProxyUtils.createRemoteMethod(md, functionName, 'remote')  & Chr(10) & Chr(10) />
  +
   			</cfif>
  -			<cfset md = md.extends />
   		</cfloop>
  -		
  -		<!--- instead of giving the proxy object the advice chains, 
  +
  +		<!--- instead of giving the proxy object the advice chains,
   			  we'll store it local and the proxy object will retrieve them --->
   		<cfset variables.proxyAdviceChains = methodAdviceChains />
  -		
  +
   		<!--- now give the methods to utils to generate a remote facade --->
   		<cfset variables.aopProxyUtils.createRemoteProxyBean(variables.serviceName,
   			   											  variables.serviceLocation,
  
positive.code: 		<cfset var functionName = '' />
  		<cfset var functionString = '' />
  		<cfset var usedFunctions = StructNew() />
  		<cfset var advisorIx = 0 />
  		<cfset var advice = 0 />
  		<cfset var bfUtils = createObject("component","coldspring.beans.util.BeanFactoryUtils").init()/>
  		<cfset var bfScope = "application"/>
  		
  		<!--- ok, very first thing, make sure this factory is going to be accessable to the generated proxies --->
  		<cfif len(variables.beanFactoryScope)>
  			<cfset bfScope = variables.beanFactoryScope/>
  
negative.code: <!---
  
    Copyright (c) 2005, Chris Scott, David Ross, Kurt Wiersma, Sean Corfield
    All rights reserved.
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
  
         http://www.apache.org/licenses/LICENSE-2.0
  
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  
    $Id: RemoteFactoryBean.cfc,v 1.9 2009/03/06 21:51:24 mandelm Exp $
    $Log: RemoteFactoryBean.cfc,v $
    Revision 1.9  2009/03/06 21:51:24  mandelm
    Added capabilities for 'addMissingmethods', for specific methods to be assigned as a remoteProxy signature.
  
    Revision 1.8  2008/04/17 22:51:21  pjf
    - Fixed CSP-96 per discussion with Chris Scott on the issue
  
  