Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) 2011, FuseSource Corp. All rights reserved. http://fusesource.com The software in this package is published under the terms of the CDDL license a copy of which has been included with this distribution in the license.txt file.
 
 package org.fusesource.fabric.dosgi;
public class Activator {
    private BundleContext bundleContext;
    private Manager manager;
    private String uri;
    private ServiceReference reference;
    public void setBundleContext(BundleContext bundleContext) {
        this. = bundleContext;
    }
    public void setUri(String uri) {
        this. = uri;
    }
    public void destroy() {
        if ( != null) {
            Manager mgr = ;
            ServiceReference ref = ;
             = null;
             = null;
            this..ungetService(ref);
            mgr.destroy();
        }
    }
    public void registerZooKeeper(ServiceReference ref) {
        try {
            destroy();
             = ref;
             = new Manager(this., (IZKClientthis..getService(), );
            .init();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    public void unregisterZooKeeper(ServiceReference reference) {
        destroy();
    }
New to GrepCode? Check out our FAQ X