Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.mortbay.hightide.example.auction.service;
 
 import java.util.List;
 import java.util.Map;
 
 import  org.mortbay.cometd.BayeuxService;
public class CategoryService extends BayeuxService
    
    private List _categories;
    
    public CategoryService(Bayeux bayeux)
    {
        super(bayeux"category");
        
        subscribe("/service/auction/categories""getCategories");        
    }    
    
    /* ================================================================ */
    
    public void getCategories(Client sourceString channelMap<StringObjectdata
            String messageId)
    {
        if(==null)
             = new CategoryDao().getAllCategories();        
        
        Map<String,Objectresponse = new HashMap<String,Object>();
        response.put("handlerId"data.get("handlerId"));
        try
        {
            response.put("categories");
        }
        catch(Exception e)
        {
            response.put("errorMsg"e.getMessage());
        }
        source.deliver(getClient(), channelresponsenull);
    }
    
    
    
New to GrepCode? Check out our FAQ X