1 /* 2 * JBoss, Home of Professional Open Source 3 * Copyright 2005, JBoss Inc., and individual contributors as indicated 4 * by the @authors tag. See the copyright.txt in the distribution for a 5 * full listing of individual contributors. 6 * 7 * This is free software; you can redistribute it and/or modify it 8 * under the terms of the GNU Lesser General Public License as 9 * published by the Free Software Foundation; either version 2.1 of 10 * the License, or (at your option) any later version. 11 * 12 * This software is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * Lesser General Public License for more details. 16 * 17 * You should have received a copy of the GNU Lesser General Public 18 * License along with this software; if not, write to the Free 19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org. 21 */ 22 package org.jboss.tm; 23 24 import org.jboss.tm.remoting.interfaces.RecoveryCoordinator; 25 import org.jboss.tm.remoting.interfaces.Resource; 26 27 /** 28 * Converts stringfied references to remote <code>Resource</code>s and 29 * <code>RecoveryCoordinator</code>s back to remote references. This 30 * interface serves the purpose of avoiding a dependency from the transaction 31 * recovery module to the CORBA/OTS module. 32 * 33 * @author <a HREF="mailto:reverbel@ime.usp.br">Francisco Reverbel</a> 34 * @version $Revision: 37459 $ 35 */ 36 public interface StringRemoteRefConverter 37 { 38 /** 39 * Converts a stringfied reference to a remote <code>Resource</code> 40 * back to a remote reference. 41 * 42 * @param strResource a stringfied reference to a remote 43 * <code>Resource</code> 44 * @return a remote reference to the <code>Resource</code>. 45 */ 46 Resource stringToResource(String strResource); 47 48 /** 49 * Converts a stringfied reference to a remote 50 * <code>RecoveryCoordinator</code> back to a remote reference. 51 * 52 * @param strRecCoordinator a stringfied reference to a remote 53 * <code>RecoveryCoordinator</code> 54 * @return a remote reference to the <code>RecoveryCoordinator</code> 55 */ 56 RecoveryCoordinator stringToRecoveryCoordinator(String strRecCoordinator); 57 58 /** 59 * Takes a remote reference to a resource and converts it to a string. 60 * 61 * @param res a remote reference to a resource 62 * @return a string that represents the remote resource. 63 */ 64 String resourceToString(Resource res); 65 66 /** 67 * Takes a remote reference to recovery coordinator and converts it to a 68 * string. 69 * 70 * @param recoveryCoord a remote reference to a recovery coordinator 71 * @return a string that represents the remote recovery coordinator. 72 */ 73 String recoveryCoordinatorToString(RecoveryCoordinator recoveryCoord); 74 } 75