Skip to content

Commit

Permalink
feature: Implement Virtual Proxy pattern iluwatar#2940
Browse files Browse the repository at this point in the history
  • Loading branch information
Adelechka committed May 14, 2024
1 parent b9228c0 commit 3cadb6b
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 49 deletions.
2 changes: 1 addition & 1 deletion proxy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<configuration>
<archive>
<manifest>
<mainClass>com.iluwatar.proxy.App</mainClass>
<mainClass>com.iluwatar.com.App</mainClass>
</manifest>
</archive>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion virtual-proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,4 @@ The virtual proxy pattern is typically used to:
## Credits

* [The Proxy Pattern in Java](https://www.baeldung.com/java-proxy-pattern)
* [What is the virtual proxy design pattern?](https://www.educative.io/answers/what-is-the-virtual-proxy-design-pattern)
* [What is the virtual proxy design pattern?](https://www.educative.io/answers/what-is-the-virtual-proxy-design-pattern)
86 changes: 43 additions & 43 deletions virtual-proxy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,47 +27,47 @@
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>virtual-proxy</artifactId>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<configuration>
<archive>
<manifest>
<mainClass>App</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.iluwatar</groupId>
<artifactId>java-design-patterns</artifactId>
<version>1.26.0-SNAPSHOT</version>
</parent>
<artifactId>virtual-proxy</artifactId>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<configuration>
<archive>
<manifest>
<mainClass>App</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package com.iluwatar.virtual.proxy;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
*/
public interface ExpensiveObject {
void process();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ private void heavyInitialConfiguration() {
public void process() {
LOGGER.info("Processing and playing video content...");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ public void process() {
}
realVideoObject.process();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package com.iluwatar.virtual.proxy;

import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ public void processDoesNotThrowException() {
RealVideoObject realVideoObject = new RealVideoObject();
assertDoesNotThrow(realVideoObject::process, "Process method should not throw any exception");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package com.iluwatar.virtual.proxy;

import static org.hamcrest.core.IsInstanceOf.instanceOf;
Expand Down

0 comments on commit 3cadb6b

Please sign in to comment.