001 /* 002 Copyright (C) 2001-2003 Renaud Pawlak 003 004 This program is free software; you can redistribute it and/or modify 005 it under the terms of the GNU Lesser General Public License as 006 published by the Free Software Foundation; either version 2 of the 007 License, or (at your option) any later version. 008 009 This program is distributed in the hope that it will be useful, 010 but WITHOUT ANY WARRANTY; without even the implied warranty of 011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 012 GNU Lesser General Public License for more details. 013 014 You should have received a copy of the GNU Lesser General Public 015 License along with this program; if not, write to the Free Software 016 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 017 USA */ 018 019 package org.objectweb.jac.aspects.distribution; 020 021 import org.objectweb.jac.core.rtti.ClassItem; 022 import org.objectweb.jac.core.rtti.MethodItem; 023 024 /** 025 * This aspect is configuration interface of the Deployment aspect. 026 * 027 * @author <a href="http://cedric.cnam.fr/~pawlak/index-english.html">Renaud Pawlak</a> 028 * 029 * @see DeploymentAC 030 * @see DeploymentRule */ 031 032 public interface DeploymentConf { 033 034 /** 035 * This configuration method creates a deployment rule that tells 036 * that the objects that match are deployed on a given remote 037 * container.<p> 038 * 039 * @param deploymentHost the host from where the objects are 040 * deployed 041 * @param nameRegexp all the objects for which the name will 042 * match this pattern will be deployed with this rule 043 * @param containerName the container that will hold the objects */ 044 045 void deploy( String deploymentHost, String nameRegexp, String containerName ); 046 047 /** 048 * This configuration method creates a deployment rule that replicates 049 * an original object on a set of containers. 050 * 051 * @param deploymentHost the host from where the objects are 052 * deployed 053 * @param nameRegexp all the objects for which the name will match 054 * this regular expression will be replicated 055 * @param contRegexp identifies the containers that will hold the 056 * replication group (one replica per container) */ 057 058 void replicate ( String deploymentHost, String nameRegexp, String contRegexp ); 059 060 /** 061 * This configuration method creates remote-access stubs for the 062 * object called name on all the client-hosts defined by the hosts 063 * expression. 064 * 065 * @param name the name of the object the stubs are created for 066 * @param serverHost the name of the container the server is located 067 * @param hosts an expression telling where the stubs are deployed 068 * @param stubType the type of the stub (a StubWrapper subclass) 069 */ 070 071 void createTypedStubsFor( String name, String serverHost, 072 String hosts, String stubType ); 073 074 /** 075 * This configuration method creates the stubs with the default 076 * type (org.objectweb.jac.core.dist.StubWrapper). 077 * 078 * @param name the name of the object the stubs are created for 079 * @param serverHost the name of the container the server is located 080 * @param hosts an expression telling where the stubs are deployed 081 */ 082 083 void createStubsFor( String name, String serverHost, String hosts ); 084 085 /** 086 * This configuration method creates the stubs with an asynchronous 087 * type (org.objectweb.jac.core.dist.NonBlockingStubWrapper). 088 * 089 * @param name the name of the object the stubs are created for 090 * @param serverHost the name of the container the server is located 091 * @param hosts an expression telling where the stubs are deployed 092 */ 093 094 void createAsynchronousStubsFor( String name, String serverHost, String hosts ); 095 096 /** 097 * This configuration method sets a field to be transient. 098 * 099 * @param classItem the class item of the field 100 * @param fieldName the field name */ 101 102 void setTransient(ClassItem classItem, String fieldName); 103 104 /** 105 * Defines the passing mode of the parameters for a given method. 106 * 107 * <p>When a method is fowarded to a remote host by a stub 108 * (wrapper), the parameters of this method can be passed by value 109 * (then the whole object is serialized on the local host and 110 * deserialized on the remote host) or by reference (then the 111 * object's state is not serialized and it is bounded to a remote 112 * object on the remote host). 113 * 114 * @param method the method that holds the parameters 115 * @param refs TRUE or FALSE for each parameter... by default, the 116 * parameters are passed by value */ 117 void setParametersPassingMode(MethodItem method, Boolean[] refs); 118 119 } 120 121