Creates new JmxReporter for the specified manager with default values.

@param manager manager that will be used by JmxReporter
@return new JmxReporter
772420
static public JmxReporter forManager(Manager manager) {
		JmxReporter reporter = new JmxReporter(manager);

		reporter.setBeanName(DEFAULT_BEAN_NAME);
		reporter.simonDomain = DEFAULT_SIMON_DOMAIN;
		reporter.beanServer = ManagementFactory.getPlatformMBeanServer();

		return reporter;
	}
513961
public synchronized void register() throws Exception {
        if (mbeanName != null) {
            throw new Exception("Agent already registered");
        }
        mbeanName = new ObjectName(getClass().getPackage().getName() + ":type=" + getClass().getSimpleName());
        logger.info("Registering JMX agent " + mbeanName);
        ManagementFactory.getPlatformMBeanServer().registerMBean(this, mbeanName);
        logger.info("JMX agent " + mbeanName + " registered");
    }
245349
public JmsDestinationType<WebFragmentDescriptor> getOrCreateJmsDestination()
   {
      List<Node> nodeList = model.get("jms-destination");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new JmsDestinationTypeImpl<WebFragmentDescriptor>(this, "jms-destination", model, nodeList.get(0));
      }
      return createJmsDestination();
   }
1082443
@Override
	public synchronized void initialize(Manager manager) {
		if (this.manager != null) {
			throw new IllegalStateException("Callback was already initialized");
		}
		this.manager = manager;
		for (Callback callback : callbacks) {
			try {
				callback.initialize(manager);
			} catch (Exception e) {
				onManagerWarning("Callback initialization error", e);
			}
		}
	}
1335221
public static BeanManager getBeanManager(Object ctx) {
        return (BeanManager) javax.portlet.PortletContext.class.cast(ctx).getAttribute(WeldServletLifecycle.BEAN_MANAGER_ATTRIBUTE_NAME);
    }
1048872
@SuppressWarnings({"ThrowableResultOfMethodCallIgnored", "unchecked"})
    public static <X extends Throwable> X create(
            @Nonnull ExMF<X> exceptionFactory,
            @Nonnull String newMessage, @Nullable Object... messageParams) {

        String message = constructMessage(null, newMessage, messageParams);
        return exceptionFactory.produce(message);
    }
1252410
public static BeanDeployerEnvironment newConcurrentEnvironment(BeanManagerImpl manager) {
        return new BeanDeployerEnvironment(Collections.newSetFromMap(new ConcurrentHashMap<SlimAnnotatedTypeContext<?>, Boolean>()),
                Collections.newSetFromMap(new ConcurrentHashMap<Class<?>, Boolean>()), SetMultimap.<Class<?>, AbstractClassBean<?>> newConcurrentSetMultimap(),
                Collections.newSetFromMap(new ConcurrentHashMap<ProducerField<?, ?>, Boolean>()),
                SetMultimap.<WeldMethodKey, ProducerMethod<?, ?>> newConcurrentSetMultimap(),
                Collections.newSetFromMap(new ConcurrentHashMap<RIBean<?>, Boolean>()),
                Collections.newSetFromMap(new ConcurrentHashMap<ObserverInitializationContext<?, ?>, Boolean>()),
                Collections.newSetFromMap(new ConcurrentHashMap<DisposalMethod<?, ?>, Boolean>()),
                Collections.newSetFromMap(new ConcurrentHashMap<DisposalMethod<?, ?>, Boolean>()),
                Collections.newSetFromMap(new ConcurrentHashMap<DecoratorImpl<?>, Boolean>()),
                Collections.newSetFromMap(new ConcurrentHashMap<InterceptorImpl<?>, Boolean>()),
                Collections.newSetFromMap(new ConcurrentHashMap<Type, Boolean>()), manager);
    }
1233292
protected function createConnection(Manager $manager)
    {
        return Connection::create($this->getName())
            ->setConnectionType(function () use ($manager) {
                return $this->getType($manager);
            })
            ->setConnectionResolver($this->createResolverFunction())
            ->setArgs($this->createArgs($manager))
            ->setSortableFields($this->getSortableFields())
            ->setDefaultLimit($this->getPaginationLimit())
            ->setMaximumLimit($this->getMaximumPaginationLimit());
    }
427227
@XmlElementDecl(namespace = "http://www.ibm.com/websphere/wim", name = "manager")
    public JAXBElement<IdentifierType> createManager(IdentifierType value) {
        return new JAXBElement<IdentifierType>(_Manager_QNAME, IdentifierType.class, null, value);
    }
1192121
static RequestCreator<JmxExecRequest> newCreator() {
        return new RequestCreator<JmxExecRequest>() {
            /** {@inheritDoc} */
            public JmxExecRequest create(Stack<String> pStack, ProcessingParameters pParams) throws MalformedObjectNameException {
                return new JmxExecRequest(
                        pStack.pop(), // Object name
                        pStack.pop(), // Operation name
                        convertSpecialStringTags(prepareExtraArgs(pStack)), // arguments
                        pParams);
            }

            /** {@inheritDoc} */
            public JmxExecRequest create(Map<String, ?> requestMap, ProcessingParameters pParams)
                    throws MalformedObjectNameException {
                return new JmxExecRequest(requestMap,pParams);
            }
        };
    }
287884
def create_manager(self, instance, superclass):
        
        rel_model = self.rating_model
        rated_model = self.rated_model

        class RelatedManager(superclass):
            def get_query_set(self):
                qs = RatingsQuerySet(rel_model, rated_model=rated_model)
                return qs.filter(**(self.core_filters))

            def add(self, *objs):
                lookup_kwargs = rel_model.lookup_kwargs(instance)
                for obj in objs:
                    if not isinstance(obj, self.model):
                        raise TypeError("'%s' instance expected" %
                                        self.model._meta.object_name)
                    for (k, v) in lookup_kwargs.iteritems():
                        setattr(obj, k, v)
                    obj.save()
            add.alters_data = True

            def create(self, **kwargs):
                kwargs.update(rel_model.lookup_kwargs(instance))
                return super(RelatedManager, self).create(**kwargs)
            create.alters_data = True

            def get_or_create(self, **kwargs):
                kwargs.update(rel_model.lookup_kwargs(instance))
                return super(RelatedManager, self).get_or_create(**kwargs)
            get_or_create.alters_data = True

            def remove(self, *objs):
                for obj in objs:
                    # Is obj actually part of this descriptor set?
                    if obj in self.all():
                        obj.delete()
                    else:
                        raise rel_model.DoesNotExist(
                            "%r is not related to %r." % (obj, instance))
            remove.alters_data = True

            def clear(self):
                self.all().delete()
            clear.alters_data = True

            def rate(self, user, score):
                rating, created = self.get_or_create(user=user)
                if created or score != rating.score:
                    rating.score = score
                    rating.save()
                return rating

            def unrate(self, user):
                return self.filter(user=user,
                                   **rel_model.lookup_kwargs(instance)
                                   ).delete()

            def perform_aggregation(self, aggregator):
                score = self.all().aggregate(agg=aggregator('score'))
                return score['agg']

            def cumulative_score(self):
                # simply the sum of all scores, useful for +1/-1
                return self.perform_aggregation(models.Sum)

            def average_score(self):
                # the average of all the scores, useful for 1-5
                return self.perform_aggregation(models.Avg)

            def standard_deviation(self):
                # the standard deviation of all the scores, useful for 1-5
                return self.perform_aggregation(models.StdDev)

            def variance(self):
                # the variance of all the scores, useful for 1-5
                return self.perform_aggregation(models.Variance)

            def similar_items(self):
                return SimilarItem.objects.get_for_item(instance)

        manager = RelatedManager()
        manager.core_filters = rel_model.lookup_kwargs(instance)
        manager.model = rel_model

        return manager
696185
EntityManager build(EntityManagerContext entityManagerContext) {
        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
        return (EntityManager) Proxy.newProxyInstance(
                classLoader,
                new Class[]{EntityManager.class},
                new SharedEntityManagerInvocationHandler(entityManagerContext));
    }
301150
private javax.jms.Message messageHandler(MessageManager messageManager) throws JMSException {
        if (messageManager == null) {
            return null;
        }        
        javax.jms.Message message = messageManager.getMessage();
        
        // Notify PrefetchThread that message is dispatched
        this.messageDispatched();
        acknowledger.notifyMessageReceived((SQSMessage) message);
        return message;
    }
979712
def add_to_manager(self, manager):
        
        # Derive version spec allowing us to filter against major/minor buckets
        spec = self.spec or self.default_spec(manager)
        # Only look in appropriate major version/family; if self is an issue
        # declared as living in e.g. >=2, this means we don't even bother
        # looking in the 1.x family.
        families = [Version(str(x)) for x in manager]
        versions = list(spec.filter(families))
        for version in versions:
            family = version.major
            # Within each family, we further limit which bugfix lines match up
            # to what self cares about (ignoring 'unreleased' until later)
            candidates = [
                Version(x)
                for x in manager[family]
                if not x.startswith('unreleased')
            ]
            # Select matching release lines (& stringify)
            buckets = []
            bugfix_buckets = [str(x) for x in spec.filter(candidates)]
            # Add back in unreleased_* as appropriate
            # TODO: probably leverage Issue subclasses for this eventually?
            if self.is_buglike:
                buckets.extend(bugfix_buckets)
                # Don't put into JUST unreleased_bugfix; it implies that this
                # major release/family hasn't actually seen any releases yet
                # and only exists for features to go into.
                if bugfix_buckets:
                    buckets.append('unreleased_bugfix')
            # Obtain list of minor releases to check for "haven't had ANY
            # releases yet" corner case, in which case ALL issues get thrown in
            # unreleased_feature for the first release to consume.
            # NOTE: assumes first release is a minor or major one,
            # but...really? why would your first release be a bugfix one??
            no_releases = not self.minor_releases(manager)
            if self.is_featurelike or self.backported or no_releases:
                buckets.append('unreleased_feature')
            # Now that we know which buckets are appropriate, add ourself to
            # all of them. TODO: or just...do it above...instead...
            for bucket in buckets:
                manager[family][bucket].append(self)
161142
function _new_manager(){
    var engine = new jquery_engine(golr_response);
    engine.method('GET');
    engine.use_jsonp(true);
    var manager = new golr_manager(gserv_bulk, gconf, engine, 'async');
    return manager;
}
1283860
static EntityManager createProxy(final HibernateEntityManagerFactory factory) {
        final EntityManagerInterceptor handler = new EntityManagerInterceptor(factory);

        final Enhancer e = new Enhancer();

        // make sure we're Serializable and have a write replace method
        e.setInterfaces(new Class[] { EntityManager.class, Serializable.class, IWriteReplace.class });
        e.setSuperclass(Object.class);
        e.setCallback(handler);
        e.setNamingPolicy(new DefaultNamingPolicy() {
            @Override
            public String getClassName(final String prefix,
                                       final String source,
                                       final Object key,
                                       final Predicate names) {
                return super.getClassName("CROQUET_ENTITY_MANAGER_PROXY_" + prefix, source, key, names);
            }
        });

        LOG.trace("Created proxy for an EntityManager");

        return (EntityManager)e.create();
    }
448724
@Nonnull
  public EntityManager createEntityManager (@SuppressWarnings ("rawtypes") final Map aMap)
  {
    // Create entity manager (factory may be null - e.g. after close)
    final EntityManager aEntityManager = getEntityManagerFactory ().createEntityManager (aMap);
    if (aEntityManager == null)
      throw new IllegalStateException ("Failed to create EntityManager from factory " +
                                       m_aFactory +
                                       " with parameters " +
                                       aMap +
                                       "!");
    return aEntityManager;
  }