Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2008, 2010 VMware Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at Contributors: VMware Inc. - initial contribution /
 import java.util.Map;
 import java.util.Set;
Implementation of that delegates to an org.eclipse.virgo.kernel.model.Artifact for all methods and translates types that are JMX-unfriendly to types that are JMX-friendly

Concurrent Semantics

     private static final String USER_REGION_NAME = "org.eclipse.virgo.region.user";
     private static final String GLOBAL_REGION_NAME = "global";
     private final Artifact artifact;
     private final boolean newModel;
     public DelegatingManageableArtifact(@NonNull RuntimeArtifactModelObjectNameCreator artifactObjectNameCreator, @NonNull Artifact artifactboolean newModel) {
         this. = artifactObjectNameCreator;
         this. = artifact;
         this. = newModel;

     public final ObjectName[] getDependents() {
         return convertToObjectNames(this..getDependents());

     public final String getName() {
         return this..getName();

     public final String getState() {
         return this..getState().toString();

     public final String getType() {
         return this..getType();

     public final String getVersion() {
         return this..getVersion().toString();

     public String getRegion() {
         return this..getRegion().getName();

    public final boolean refresh() {
        return this..refresh();

    public final void start() {

    public final void stop() {

    public final void uninstall() {

    public final Map<StringStringgetProperties() {
        return this..getProperties();

Convert a collection of org.eclipse.virgo.kernel.model.Artifacts to a collection of

artifacts The org.eclipse.virgo.kernel.model.Artifacts to convert
The converted to
    private final ObjectName[] convertToObjectNames(Set<Artifactartifacts) {
        Set<ObjectNameobjectNames = new HashSet<ObjectName>(artifacts.size());
        String regionName;
        for (Artifact artifact : artifacts) {
            regionName = artifact.getRegion().getName();
            if( || (!.equals(regionName) && !.equals(regionName)) ){
            } else {
        return objectNames.toArray(new ObjectName[objectNames.size()]);
New to GrepCode? Check out our FAQ X