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 http://www.eclipse.org/legal/epl-v10.html Contributors: VMware Inc. - initial contribution /
 
 
 package org.eclipse.virgo.kernel.model.management.internal;
 
 import java.util.Map;
 import java.util.Set;
 
 
Implementation of org.eclipse.virgo.kernel.model.management.ManageableArtifact 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
Threadsafe

 
 
 
     private final Artifact artifact;
 
     public DelegatingManageableArtifact(@NonNull RuntimeArtifactModelObjectNameCreator artifactObjectNameCreator, @NonNull Artifact artifact) {
         this. = artifactObjectNameCreator;
         this. = artifact;
     }

    
 
     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 final boolean refresh() {
         return this..refresh();
     }

    
 
     public final void start() {
         this..start();
     }

    
 
    public final void stop() {
        this..stop();
    }

    
    public final void uninstall() {
        this..uninstall();
    }

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

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

Parameters:
artifacts The org.eclipse.virgo.kernel.model.Artifacts to convert
Returns:
The javax.management.ObjectNames converted to
    protected final ObjectName[] convertToObjectNames(Set<Artifactartifacts) {
        Set<ObjectNameobjectNames = new HashSet<ObjectName>(artifacts.size());
        for (Artifact artifact : artifacts) {
            objectNames.add(.create(artifact));
        }
        return objectNames.toArray(new ObjectName[objectNames.size()]);
    }
New to GrepCode? Check out our FAQ X