001    /*
002     * Copyright (c) 2007-2014 Concurrent, Inc. All Rights Reserved.
003     *
004     * Project and contact information: http://www.cascading.org/
005     *
006     * This file is part of the Cascading project.
007     *
008     * Licensed under the Apache License, Version 2.0 (the "License");
009     * you may not use this file except in compliance with the License.
010     * You may obtain a copy of the License at
011     *
012     *     http://www.apache.org/licenses/LICENSE-2.0
013     *
014     * Unless required by applicable law or agreed to in writing, software
015     * distributed under the License is distributed on an "AS IS" BASIS,
016     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017     * See the License for the specific language governing permissions and
018     * limitations under the License.
019     */
020    
021    package cascading.flow;
022    
023    import java.io.IOException;
024    import java.util.Collection;
025    import java.util.Map;
026    
027    import cascading.tap.Tap;
028    import cascading.tuple.TupleEntryCollector;
029    import cascading.tuple.TupleEntryIterator;
030    
031    /**
032     *
033     */
034    public class FlowProcessWrapper<Config> extends FlowProcess<Config>
035      {
036      final FlowProcess<Config> delegate;
037    
038      public static FlowProcess undelegate( FlowProcess flowProcess )
039        {
040        if( flowProcess instanceof FlowProcessWrapper )
041          return ( (FlowProcessWrapper) flowProcess ).getDelegate();
042    
043        return flowProcess;
044        }
045    
046      public FlowProcessWrapper( FlowProcess delegate )
047        {
048        this.delegate = delegate;
049        }
050    
051      public FlowProcess getDelegate()
052        {
053        return delegate;
054        }
055    
056      @Override
057      public FlowProcess copyWith( Config object )
058        {
059        return delegate.copyWith( object );
060        }
061    
062      @Override
063      public String getID()
064        {
065        return delegate.getID();
066        }
067    
068      @Override
069      public FlowSession getCurrentSession()
070        {
071        return delegate.getCurrentSession();
072        }
073    
074      @Override
075      public void setCurrentSession( FlowSession currentSession )
076        {
077        delegate.setCurrentSession( currentSession );
078        }
079    
080      @Override
081      public int getNumProcessSlices()
082        {
083        return delegate.getNumProcessSlices();
084        }
085    
086      @Override
087      public int getCurrentSliceNum()
088        {
089        return delegate.getCurrentSliceNum();
090        }
091    
092      @Override
093      public Object getProperty( String key )
094        {
095        return delegate.getProperty( key );
096        }
097    
098      @Override
099      public Collection<String> getPropertyKeys()
100        {
101        return delegate.getPropertyKeys();
102        }
103    
104      @Override
105      public Object newInstance( String className )
106        {
107        return delegate.newInstance( className );
108        }
109    
110      @Override
111      public void keepAlive()
112        {
113        delegate.keepAlive();
114        }
115    
116      @Override
117      public void increment( Enum counter, long amount )
118        {
119        delegate.increment( counter, amount );
120        }
121    
122      @Override
123      public void increment( String group, String counter, long amount )
124        {
125        delegate.increment( group, counter, amount );
126        }
127    
128      @Override
129      public void setStatus( String status )
130        {
131        delegate.setStatus( status );
132        }
133    
134      @Override
135      public boolean isCounterStatusInitialized()
136        {
137        return delegate.isCounterStatusInitialized();
138        }
139    
140      @Override
141      public TupleEntryIterator openTapForRead( Tap tap ) throws IOException
142        {
143        return delegate.openTapForRead( tap );
144        }
145    
146      @Override
147      public TupleEntryCollector openTapForWrite( Tap tap ) throws IOException
148        {
149        return delegate.openTapForWrite( tap );
150        }
151    
152      @Override
153      public TupleEntryCollector openTrapForWrite( Tap trap ) throws IOException
154        {
155        return delegate.openTrapForWrite( trap );
156        }
157    
158      @Override
159      public TupleEntryCollector openSystemIntermediateForWrite() throws IOException
160        {
161        return delegate.openSystemIntermediateForWrite();
162        }
163    
164      @Override
165      public Config getConfigCopy()
166        {
167        return delegate.getConfigCopy();
168        }
169    
170      @Override
171      public Config copyConfig( Config jobConf )
172        {
173        return delegate.copyConfig( jobConf );
174        }
175    
176      @Override
177      public Map<String, String> diffConfigIntoMap( Config defaultConfig, Config updatedConfig )
178        {
179        return delegate.diffConfigIntoMap( defaultConfig, updatedConfig );
180        }
181    
182      @Override
183      public Config mergeMapIntoConfig( Config defaultConfig, Map<String, String> map )
184        {
185        return delegate.mergeMapIntoConfig( defaultConfig, map );
186        }
187      }