Exemple #1
0
 public ResourceServiceRegistration(Type registrationInterface,
                                    Type concreteType,
                                    int registrationGroup            = Services.REGISTRATION_GROUP_DEFAULT,
                                    ServiceResourceType resourceType = ServiceResourceType.REQUIRED,
                                    string overrideResourcePath      = null)
 {
     this.registrationType = registrationInterface;
     this.concreteType     = concreteType;
     SetRegistrationGroup(registrationGroup);
     this.resourceType         = resourceType;
     this.overrideResourcePath = overrideResourcePath;
 }
Exemple #2
0
 public AdminServiceResource RegisterAdminServiceResource(
     ServiceResourceType serviceResParams)
 {
     try
     {
         return(new AdminServiceResource(this.VcloudClient, SdkUtil.Post <ServiceResourceType>(this.VcloudClient, this.Resource.href + "/serviceresources", SerializationUtil.SerializeObject <ServiceResourceType>(serviceResParams, "com.vmware.vcloud.api.rest.schema"), "application/vnd.vmware.admin.serviceResource+xml", 201)));
     }
     catch (Exception ex)
     {
         throw new VCloudException(ex.Message);
     }
 }
 public ServiceRegistrationInfo(
     Type intf,
     Type impl,
     int registrationGroup            = Services.REGISTRATION_GROUP_DEFAULT,
     ServiceResourceType resourceType = ServiceResourceType.NONE,
     string overrideResourcePath      = null)
 {
     this.interfaceType        = intf;
     this.implType             = impl;
     this.registrationGroup    = registrationGroup;
     this.resourceType         = resourceType;
     this.overrideResourcePath = overrideResourcePath;
 }
 public ResourceServiceAttribute(ServiceResourceType serviceResourceType = ServiceResourceType.REQUIRED, string overrideResourcePath = null)
 {
     this.serviceResourceType  = serviceResourceType;
     this.overrideResourcePath = overrideResourcePath;
 }
Exemple #5
0
        public void Register(Type registrationInterface, Type concreteType, int registrationGroup, ServiceResourceType resourceType = ServiceResourceType.NONE, string overrideResourcePath = null)
        {
            if (!registrationInterface.IsAssignableFrom(concreteType))
            {
                throw new ArgumentException("Registration interface " + registrationInterface.Name
                                            + " must be assignable from concrete type " + concreteType.Name);
            }

            var reg = resourceType != ServiceResourceType.NONE ? (ServiceRegistration)
                      new ResourceServiceRegistration(registrationInterface, concreteType, registrationGroup, resourceType, overrideResourcePath) :
                      new FactoryServiceRegistration(registrationInterface, concreteType, registrationGroup);


            reg.SetServiceRegistration(this);
        }