lib/services/ObjectService.js
function(policyName)
	{        
        var app = this;
		var objectName = policyName;
		var obj = {};
		try
		{
            if(app.policies.hasOwnProperty(policyName)){
                obj = app.policies[policyName];
            }else{                
                throw "not found";
            }
		}
		catch(e)
		{					
			var objFilePath = path.join(app._path,"policies",policyName);            
			if(fs.existsSync(objFilePath+".js"))
			{                
				obj = require(objFilePath);				
				if(typeof app.policies != "object") app.policies={};
				app.policies[policyName] = obj;
			}
		}        
		return obj;
	}
function(policyName)
	{        
        var app = this;
		var objectName = policyName;
		var obj = {};
		try
		{
            if(app.policies.hasOwnProperty(policyName)){
                obj = app.policies[policyName];
            }else{                
                throw "not found";
            }
		}
		catch(e)
		{					
			var objFilePath = path.join(app._path,"policies",policyName);            
			if(fs.existsSync(objFilePath+".js"))
			{                
				obj = require(objFilePath);				
				if(typeof app.policies != "object") app.policies={};
				app.policies[policyName] = obj;
			}
		}        
		return obj;
	}
function ( policyName ) { var app = this ; var objectName = policyName ; var obj = { } ; try { if ( app . policies . hasOwnProperty ( policyName ) ) { obj = app . policies [ policyName ] ; } else { throw "not found" ; } } catch ( e ) { var objFilePath = path . join ( app . _path , "policies" , policyName ) ; if ( fs . existsSync ( objFilePath + ".js" ) ) { obj = require ( objFilePath ) ; if ( typeof app . policies != "object" ) app . policies = { } ; app . policies [ policyName ] = obj ; } } return obj ; }
Get specified openbiz policy middle-ware function.

This method it part of {@link openbiz.objects.Application},
please never call this directly by ObjectService.

if need to call this method, you have to use javascript's function.apply(applicationPointer,params)
please see sample
@memberof openbiz.services.ObjectService
@param {string} policyName - The specified policy middle-ware name
@returns {function}
@example
//below code is how to get the middle-ware of "cubi.user.ensureSomething" function
//cubiApp is instance of openbiz.objects.Application
var something = cubiApp.getPolicy("ensureSomething");
@example
//if you want to call this method directly , please try this way
require('openbiz/services/ObjectService').getPolicy.apply(applicationPointer,policyName)
Get specified openbiz policy middle - ware function .