<p>Registers {@link Bundler} instances with this service. See that interface for details.
174044
public void register(Bundler bundler) {
    if (bundler == null) throw new NullPointerException("Cannot register null bundler.");

    if (runner.state == BundleServiceRunner.State.SAVING) {
      throw new IllegalStateException("Cannot register during onSave");
    }

    if (bundlers.add(bundler)) bundler.onEnterScope(scope);
    String mortarBundleKey = bundler.getMortarBundleKey();
    if (mortarBundleKey == null || mortarBundleKey.trim().equals("")) {
      throw new IllegalArgumentException(format("%s has null or empty bundle key", bundler));
    }

    switch (runner.state) {
      case IDLE:
        toBeLoaded.add(bundler);
        runner.servicesToBeLoaded.add(this);
        runner.finishLoading();
        break;
      case LOADING:
        if (!toBeLoaded.contains(bundler)) {
          toBeLoaded.add(bundler);
          runner.servicesToBeLoaded.add(this);
        }
        break;

      default:
        throw new AssertionError("Unexpected state " + runner.state);
    }
  }
135699
public <R, W> JSONer register(Converter<R, W> converter, Class<?>... types) {
        for (Class<?> type : checkNotNull(types)) {
            typeConverts.put(type, checkNotNull(converter));
        }
        return this;
    }
699071
public void register(String simpleName, Class<? extends T> clazz) {
        this.constructors.put(simpleName, clazz);
    }
727276
public void storeBundle(String bundleName, StringBuffer bundledResources) {

		JoinableResourceBundleContent bundleResourcesContent = new JoinableResourceBundleContent(bundledResources);
		storeBundle(bundleName, bundleResourcesContent);
	}
609985
public void setBundleIds(java.util.Collection<String> bundleIds) {
        if (bundleIds == null) {
            this.bundleIds = null;
            return;
        }

        this.bundleIds = new com.amazonaws.internal.SdkInternalList<String>(bundleIds);
    }
573278
public static <T> void register(final Class<T> service) {
        for (T each : ServiceLoader.load(service)) {
            registerServiceClass(service, each);
        }
    }
93085
public void registerDeferredService(BundleContext bundleContext, Class<?> providedService, Dictionary dict) {
        Object obj = serviceReg.get();
        if (obj instanceof ServiceRegistration<?>) {
            // already registered - nothing to do here
            return;
        }
        if (obj instanceof CountDownLatch) {
            // another thread is in the process of (de)registering - wait for it to finish
            try {
                ((CountDownLatch) obj).await();

                if (serviceReg.get() instanceof ServiceRegistration<?>) {
                    // Another thread has successfully registered to return out (so we don't go
                    // into recursive loop).
                    return;
                }
            } catch (InterruptedException swallowed) {
                if (tc.isDebugEnabled()) {
                    Tr.debug(tc, "Count down interrrupted", swallowed);
                }
            }
        } else {
            // This is probably the first thread to register.
            // Claim the right to register by setting a latch for other threads to wait on.
            CountDownLatch latch = new CountDownLatch(1);
            if (serviceReg.compareAndSet(null, latch)) {
                // This thread won the right to register the service
                try {
                    serviceReg.set(bundleContext.registerService(providedService.getName(), this, dict));
                    // successfully registered - nothing more to do
                    return;
                } finally {
                    // if the serviceReg was not updated for any reason, we need to set it back to null
                    serviceReg.compareAndSet(latch, null);
                    // in any case we need to allow any blocked threads to proceed
                    latch.countDown();
                }
            }
        }
        // If we get to here we have not successfully registered 
        // nor seen another thread successfully register, so just recurse.
        registerDeferredService(bundleContext, providedService, dict);
    }
1143199
public final void register() {
        synchronized (this) {
            if (filterFactoryServiceRegistration != null) {
                throw new IllegalStateException(String.format("%s [%s] has been registered.", getClass()
                    .getSimpleName(), this));
            }
            filterFactoryServiceRegistration = bundleContext.registerService(SERVICE_CLASSES, this, properties);
            LOGGER.info("Registered filterFactory for application {} with priority {}", getApplicationName(),
                getPriority());
        }
    }
283938
@SafeVarargs
    public static void enableBundles(final Class<? extends GuiceyBundle>... bundles) {
        final String prop = Joiner.on(',').join(toStrings(Lists.newArrayList(bundles)));
        System.setProperty(BUNDLES_PROPERTY, prop);
    }
1365988
public void start(BundleContext context) throws Exception {
        ClassServiceUtility.log(context, LogService.LOG_INFO, "Starting " + this.getClass().getName() + " Bundle");
        
        this.context = context;
        this.init();	// Setup the properties
        
		String interfaceClassName = getInterfaceClassName();
		this.setProperty(BundleConstants.ACTIVATOR, this.getClass().getName());	// In case I have to find this service by activator class

        try {
			context.addServiceListener(this, ClassServiceUtility.addToFilter((String)null, Constants.OBJECTCLASS, interfaceClassName));
		} catch (InvalidSyntaxException e) {
			e.printStackTrace();
		}
		
        if (service == null)
        {
            boolean allStarted = this.checkDependentServices(context);
            if (allStarted)
            {
            	service = this.startupService(context);
            	this.registerService(service);
            }
        }
    }
406272
public void registerLookupBundles(final List<GuiceyBundle> bundles) {
        setScope(ConfigScope.BundleLookup.getType());
        for (GuiceyBundle bundle : bundles) {
            register(ConfigItem.Bundle, bundle);
        }
        closeScope();
        lifecycle().bundlesFromLookupResolved(bundles);
        lifecycle().bundlesResolved(getEnabledBundles(), getDisabledBundles());
    }
1153604
public function registerAssets()
    {
        $view = $this->getView();
        $bundle = NotyAsset::register($view);
        $bundle->animateCss = $this->registerAnimateCss;
        $bundle->buttonsCss = $this->registerButtonsCss;
    }
1128009
public void registerServiceInstance(ProvidedServiceInstance instance, final RegistrationCallback cb, Object context){

        ProtocolHeader header = new ProtocolHeader();
        header.setType(ProtocolType.RegisterServiceInstance);

        RegisterServiceInstanceProtocol p = new RegisterServiceInstanceProtocol(instance);

        ProtocolCallback pcb = new ProtocolCallback(){

            @Override
            public void call(boolean result, Response response,
                    ErrorCode error, Object ctx) {
                cb.call(result, error, ctx);
            }

        };

        connection.submitCallbackRequest(header, p, pcb, context);

    }
156642
public void register() {
        if (registration != null) {
            throw new IllegalStateException("Webapplication is already registered.");
        }
        validateNotNull(applicationName, "applicationName");
        validateNotNull(mountPoint, "mountPoint");
        Hashtable<String, Object> props = new Hashtable<String, Object>();
        props.put(Constants.APPLICATION_NAME, applicationName);
        props.put(Constants.MOUNTPOINT, mountPoint);
        props.put(Constants.CONTEXT_PARAMS, contextParam);
        registration = bundleContext.registerService(WebApplicationFactory.class, this, props);
    }
704842
public void register(BeanMappingBuilder builder) {
        if (builder != null) {
            BeanMappingObject object = builder.get();
            register(object);
        }
    }
882905
@Override
	public void init(ResourceBundlesHandler bundler, Boolean useRandomParam, Boolean async, Boolean defer,
			String crossorigin) {
		init(bundler, DEFAULT_TYPE, useRandomParam, async, defer, crossorigin);
	}
262106
@Override
	public void registerConsumer(LocalMessageConsumer consumer)
    {
        super.registerConsumer(consumer);
        
        subscriptionsLock.writeLock().lock();
        try
		{
        	LocalTopicSubscription subscription = subscriptionMap.remove(consumer.getSubscriberId());
        	if (subscription == null)
        	{
        		// New subscription
        		storeNewSubscription(consumer);
        	}
        	else
        	{
        		// Remove old subscription
        		removeSubscription(subscription);
        		// Replace by new subscription
        		storeNewSubscription(consumer);
        	}
		}
        finally
        {
        	subscriptionsLock.writeLock().unlock();
        }
    }