Coverage Report - org.apache.tapestry5.corelib.pages.ServiceStatus
 
Classes in this File Line Coverage Branch Coverage Complexity
ServiceStatus
100%
7/7
N/A
0
 
 1  
 // Copyright 2007, 2008 The Apache Software Foundation
 2  
 //
 3  
 // Licensed under the Apache License, Version 2.0 (the "License");
 4  
 // you may not use this file except in compliance with the License.
 5  
 // You may obtain a copy of the License at
 6  
 //
 7  
 //     http://www.apache.org/licenses/LICENSE-2.0
 8  
 //
 9  
 // Unless required by applicable law or agreed to in writing, software
 10  
 // distributed under the License is distributed on an "AS IS" BASIS,
 11  
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12  
 // See the License for the specific language governing permissions and
 13  
 // limitations under the License.
 14  
 
 15  
 package org.apache.tapestry5.corelib.pages;
 16  
 
 17  
 import org.apache.tapestry5.SymbolConstants;
 18  
 import org.apache.tapestry5.annotations.ContentType;
 19  
 import org.apache.tapestry5.annotations.Property;
 20  
 import org.apache.tapestry5.beaneditor.BeanModel;
 21  
 import org.apache.tapestry5.ioc.Messages;
 22  
 import org.apache.tapestry5.ioc.Registry;
 23  
 import org.apache.tapestry5.ioc.annotations.Inject;
 24  
 import org.apache.tapestry5.ioc.annotations.Symbol;
 25  
 import org.apache.tapestry5.ioc.services.ServiceActivity;
 26  
 import org.apache.tapestry5.ioc.services.ServiceActivityScoreboard;
 27  
 import org.apache.tapestry5.services.BeanModelSource;
 28  
 
 29  
 import java.util.List;
 30  
 
 31  
 /**
 32  
  * Page used to see the status of all services defined by the {@link Registry}.
 33  
  * <p/>
 34  
  * TODO: Add filters to control which services are displayed
 35  
  */
 36  
 @ContentType("text/html")
 37  2
 public class ServiceStatus
 38  
 {
 39  
     @Inject
 40  
     private ServiceActivityScoreboard scoreboard;
 41  
 
 42  
     @Property
 43  
     private List<ServiceActivity> activity;
 44  
 
 45  
     @Property
 46  
     private ServiceActivity row;
 47  
 
 48  
     @Inject
 49  
     private BeanModelSource source;
 50  
 
 51  
     @Property
 52  
     private final BeanModel model;
 53  
 
 54  
     @Inject
 55  
     private Messages messages;
 56  
 
 57  
     @Property
 58  
     @Inject
 59  
     @Symbol(SymbolConstants.PRODUCTION_MODE)
 60  
     private boolean productionMode;
 61  
 
 62  
     {
 63  2
         model = source.createDisplayModel(ServiceActivity.class, messages);
 64  
 
 65  2
         model.add("serviceInterface", null);
 66  
 
 67  
         // There's no line number information for interfaces, so we'll reorder the
 68  
         // propreties manually.
 69  
 
 70  2
         model.reorder("serviceId", "serviceInterface", "scope", "status");
 71  2
     }
 72  
 
 73  
     void setupRender()
 74  
     {
 75  2
         activity = scoreboard.getServiceActivity();
 76  2
     }
 77  
 }