Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) FuseSource, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
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;
    public void registerZooKeeper(ServiceReference ref) {
        try {
             = ref;
             = new Manager(this., (IZKClientthis..getService(), );
        } catch (Exception e) {
            throw new RuntimeException("Unable to start DOSGi service: " + e.getMessage(), e);
    public void unregisterZooKeeper(ServiceReference reference) {
New to GrepCode? Check out our FAQ X