Coverage Report - org.kuali.rice.ksb.messaging.objectremoting.RemoteObjectCleanup
 
Classes in this File Line Coverage Branch Coverage Complexity
RemoteObjectCleanup
0%
0/20
N/A
1
 
 1  
 /*
 2  
  * Copyright 2005-2007 The Kuali Foundation
 3  
  * 
 4  
  * 
 5  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 6  
  * you may not use this file except in compliance with the License.
 7  
  * You may obtain a copy of the License at
 8  
  * 
 9  
  * http://www.opensource.org/licenses/ecl2.php
 10  
  * 
 11  
  * Unless required by applicable law or agreed to in writing, software
 12  
  * distributed under the License is distributed on an "AS IS" BASIS,
 13  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14  
  * See the License for the specific language governing permissions and
 15  
  * limitations under the License.
 16  
  */
 17  
 package org.kuali.rice.ksb.messaging.objectremoting;
 18  
 
 19  
 import javax.transaction.Synchronization;
 20  
 import javax.xml.namespace.QName;
 21  
 
 22  
 import org.apache.log4j.Logger;
 23  
 import org.kuali.rice.core.resourceloader.GlobalResourceLoader;
 24  
 import org.springframework.transaction.support.TransactionSynchronization;
 25  
 
 26  
 /**
 27  
  * {@link Synchronization} to cleanup any remote objects created during the
 28  
  * current transaction.
 29  
  * 
 30  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 31  
  */
 32  
 public class RemoteObjectCleanup implements TransactionSynchronization {
 33  
 
 34  0
         private static final Logger LOG = Logger.getLogger(RemoteObjectCleanup.class);
 35  
 
 36  
         private QName objectRemoterName;
 37  
 
 38  
         private QName serviceToRemove;
 39  
 
 40  0
         public RemoteObjectCleanup(QName objectRemoterName, QName serviceToRemove) {
 41  0
                 this.setObjectRemoterName(objectRemoterName);
 42  0
                 this.setServiceToRemove(serviceToRemove);
 43  0
         }
 44  
 
 45  
         public void afterCompletion(int status) {
 46  0
                 LOG.debug("Removing service: " + this.getServiceToRemove() + " from ObjectRemoter: " + this.getObjectRemoterName());
 47  0
                 ObjectRemoterService objectRemoter = (ObjectRemoterService) GlobalResourceLoader.getService(this.getObjectRemoterName());
 48  0
                 objectRemoter.removeService(this.getServiceToRemove());
 49  0
         }
 50  
 
 51  
         public void beforeCompletion() {
 52  
             // template method
 53  0
         }
 54  
 
 55  
         public QName getObjectRemoterName() {
 56  0
                 return this.objectRemoterName;
 57  
         }
 58  
 
 59  
         public void setObjectRemoterName(QName objectRemoterName) {
 60  0
                 this.objectRemoterName = objectRemoterName;
 61  0
         }
 62  
 
 63  
         public QName getServiceToRemove() {
 64  0
                 return this.serviceToRemove;
 65  
         }
 66  
 
 67  
         public void setServiceToRemove(QName serviceToRemove) {
 68  0
                 this.serviceToRemove = serviceToRemove;
 69  0
         }
 70  
 
 71  
         public void afterCommit() {
 72  0
         }
 73  
 
 74  
         public void beforeCommit(boolean readOnly) {
 75  0
         }
 76  
 
 77  
         public void resume() {
 78  0
         }
 79  
 
 80  
         public void suspend() {
 81  0
         }
 82  
 }