public SPServiceApplicationProxy CreateProxy(string name, SPServiceApplication serviceApplication, SPServiceProvisioningContext provisioningContext) { if (serviceApplication.GetType() != typeof(BaristaServiceApplication)) { throw new NotSupportedException(); } if (serviceApplication == null) { throw new ArgumentNullException("serviceApplication"); } // verify the service proxy exists var serviceProxy = (BaristaServiceProxy)Farm.GetObject(name, Farm.Id, typeof(BaristaServiceProxy)); if (serviceProxy == null) { throw new InvalidOperationException("BaristaServiceProxy does not exist in the farm."); } // if the app proxy doesn't exist, create it var applicationProxy = serviceProxy.ApplicationProxies.GetValue <BaristaServiceApplicationProxy>(name); if (applicationProxy == null) { var serviceAppAddress = ((BaristaServiceApplication)serviceApplication).Uri; applicationProxy = new BaristaServiceApplicationProxy(name, serviceProxy, serviceAppAddress); } return(applicationProxy); }
public void Exec(BrewRequest request) { BaristaServiceApplicationProxy.Invoke( m_serviceContext, proxy => proxy.Exec(request) ); }
public BrewResponse Eval(BrewRequest request) { BrewResponse result = null; BaristaServiceApplicationProxy.Invoke( m_serviceContext, proxy => result = proxy.Eval(request) ); return(result); }
public string AddPackage(byte[] bundlePackage) { string result = string.Empty; BaristaServiceApplicationProxy.Invoke( m_serviceContext, proxy => result = proxy.AddPackage(bundlePackage) ); return(result); }
public string ListPackages() { string result = string.Empty; BaristaServiceApplicationProxy.Invoke( m_serviceContext, proxy => result = proxy.ListPackages() ); return(result); }