Skip to content

Commit

Permalink
Merge pull request #53 from pferraro/master
Browse files Browse the repository at this point in the history
Update to WF 22.0.1.Final.
  • Loading branch information
pferraro authored Feb 19, 2021
2 parents c658952 + 6513d2f commit 7076471
Show file tree
Hide file tree
Showing 23 changed files with 65 additions and 152 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public long getCreationTime() {

@Override
public long getLastAccessedTime() {
return session.getMetaData().getLastAccessedTime().toEpochMilli();
return session.getMetaData().getLastAccessStartTime().toEpochMilli();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public String getIdInternal() {
@Override
public long getLastAccessedTime() {
try (BatchContext context = this.manager.getSessionManager().getBatcher().resumeBatch(this.batch)) {
return this.session.getMetaData().getLastAccessedTime().toEpochMilli();
return this.session.getMetaData().getLastAccessStartTime().toEpochMilli();
}
}

Expand Down Expand Up @@ -204,7 +204,7 @@ public void tellChangedSessionId(String newId, String oldId, boolean notifySessi
newSession.getAttributes().setAttribute(name, oldSession.getAttributes().getAttribute(name));
}
newSession.getMetaData().setMaxInactiveInterval(oldSession.getMetaData().getMaxInactiveInterval());
newSession.getMetaData().setLastAccessedTime(oldSession.getMetaData().getLastAccessedTime());
newSession.getMetaData().setLastAccess(oldSession.getMetaData().getLastAccessStartTime(), oldSession.getMetaData().getLastAccessEndTime());
newSession.getLocalContext().setAuthType(oldSession.getLocalContext().getAuthType());
newSession.getLocalContext().setPrincipal(oldSession.getLocalContext().getPrincipal());
this.session = newSession;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public long getCreationTime() {
@Override
public long getLastAccessedTime() {
try (BatchContext context = this.manager.getSessionManager().getBatcher().resumeBatch(this.batch)) {
return this.session.getMetaData().getLastAccessedTime().toEpochMilli();
return this.session.getMetaData().getLastAccessStartTime().toEpochMilli();
}
}

Expand Down
2 changes: 1 addition & 1 deletion 10.0/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</modules>

<properties>
<version.org.apache.tomcat>10.0.0</version.org.apache.tomcat>
<version.org.apache.tomcat>10.0.2</version.org.apache.tomcat>
</properties>

<dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public long getCreationTime() {

@Override
public long getLastAccessedTime() {
return session.getMetaData().getLastAccessedTime().toEpochMilli();
return session.getMetaData().getLastAccessStartTime().toEpochMilli();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public String getIdInternal() {
@Override
public long getLastAccessedTime() {
try (BatchContext context = this.manager.getSessionManager().getBatcher().resumeBatch(this.batch)) {
return this.session.getMetaData().getLastAccessedTime().toEpochMilli();
return this.session.getMetaData().getLastAccessStartTime().toEpochMilli();
}
}

Expand Down Expand Up @@ -201,7 +201,7 @@ public void tellChangedSessionId(String newId, String oldId) {
newSession.getAttributes().setAttribute(name, oldSession.getAttributes().getAttribute(name));
}
newSession.getMetaData().setMaxInactiveInterval(oldSession.getMetaData().getMaxInactiveInterval());
newSession.getMetaData().setLastAccessedTime(oldSession.getMetaData().getLastAccessedTime());
newSession.getMetaData().setLastAccess(oldSession.getMetaData().getLastAccessStartTime(), oldSession.getMetaData().getLastAccessEndTime());
newSession.getLocalContext().setAuthType(oldSession.getLocalContext().getAuthType());
newSession.getLocalContext().setPrincipal(oldSession.getLocalContext().getPrincipal());
this.session = newSession;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public long getCreationTime() {
@Override
public long getLastAccessedTime() {
try (BatchContext context = this.manager.getSessionManager().getBatcher().resumeBatch(this.batch)) {
return this.session.getMetaData().getLastAccessedTime().toEpochMilli();
return this.session.getMetaData().getLastAccessStartTime().toEpochMilli();
}
}

Expand Down
2 changes: 1 addition & 1 deletion 7.0/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</modules>

<properties>
<version.org.apache.tomcat>7.0.107</version.org.apache.tomcat>
<version.org.apache.tomcat>7.0.108</version.org.apache.tomcat>
</properties>

<dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public long getCreationTime() {

@Override
public long getLastAccessedTime() {
return session.getMetaData().getLastAccessedTime().toEpochMilli();
return session.getMetaData().getLastAccessStartTime().toEpochMilli();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public String getIdInternal() {
@Override
public long getLastAccessedTime() {
try (BatchContext context = this.manager.getSessionManager().getBatcher().resumeBatch(this.batch)) {
return this.session.getMetaData().getLastAccessedTime().toEpochMilli();
return this.session.getMetaData().getLastAccessStartTime().toEpochMilli();
}
}

Expand Down Expand Up @@ -204,7 +204,7 @@ public void tellChangedSessionId(String newId, String oldId, boolean notifySessi
newSession.getAttributes().setAttribute(name, oldSession.getAttributes().getAttribute(name));
}
newSession.getMetaData().setMaxInactiveInterval(oldSession.getMetaData().getMaxInactiveInterval());
newSession.getMetaData().setLastAccessedTime(oldSession.getMetaData().getLastAccessedTime());
newSession.getMetaData().setLastAccess(oldSession.getMetaData().getLastAccessStartTime(), oldSession.getMetaData().getLastAccessEndTime());
newSession.getLocalContext().setAuthType(oldSession.getLocalContext().getAuthType());
newSession.getLocalContext().setPrincipal(oldSession.getLocalContext().getPrincipal());
this.session = newSession;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public long getCreationTime() {
@Override
public long getLastAccessedTime() {
try (BatchContext context = this.manager.getSessionManager().getBatcher().resumeBatch(this.batch)) {
return this.session.getMetaData().getLastAccessedTime().toEpochMilli();
return this.session.getMetaData().getLastAccessStartTime().toEpochMilli();
}
}

Expand Down
2 changes: 1 addition & 1 deletion 8.5/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</modules>

<properties>
<version.org.apache.tomcat>8.5.61</version.org.apache.tomcat>
<version.org.apache.tomcat>8.5.63</version.org.apache.tomcat>
</properties>

<dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public long getCreationTime() {

@Override
public long getLastAccessedTime() {
return session.getMetaData().getLastAccessedTime().toEpochMilli();
return session.getMetaData().getLastAccessStartTime().toEpochMilli();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public String getIdInternal() {
@Override
public long getLastAccessedTime() {
try (BatchContext context = this.manager.getSessionManager().getBatcher().resumeBatch(this.batch)) {
return this.session.getMetaData().getLastAccessedTime().toEpochMilli();
return this.session.getMetaData().getLastAccessStartTime().toEpochMilli();
}
}

Expand Down Expand Up @@ -204,7 +204,7 @@ public void tellChangedSessionId(String newId, String oldId, boolean notifySessi
newSession.getAttributes().setAttribute(name, oldSession.getAttributes().getAttribute(name));
}
newSession.getMetaData().setMaxInactiveInterval(oldSession.getMetaData().getMaxInactiveInterval());
newSession.getMetaData().setLastAccessedTime(oldSession.getMetaData().getLastAccessedTime());
newSession.getMetaData().setLastAccess(oldSession.getMetaData().getLastAccessStartTime(), oldSession.getMetaData().getLastAccessEndTime());
newSession.getLocalContext().setAuthType(oldSession.getLocalContext().getAuthType());
newSession.getLocalContext().setPrincipal(oldSession.getLocalContext().getPrincipal());
this.session = newSession;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public long getCreationTime() {
@Override
public long getLastAccessedTime() {
try (BatchContext context = this.manager.getSessionManager().getBatcher().resumeBatch(this.batch)) {
return this.session.getMetaData().getLastAccessedTime().toEpochMilli();
return this.session.getMetaData().getLastAccessStartTime().toEpochMilli();
}
}

Expand Down
2 changes: 1 addition & 1 deletion 9.0/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</modules>

<properties>
<version.org.apache.tomcat>9.0.41</version.org.apache.tomcat>
<version.org.apache.tomcat>9.0.43</version.org.apache.tomcat>
</properties>

<dependencyManagement>
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.io.OutputStream;
import java.io.Serializable;

import org.wildfly.clustering.marshalling.Externalizer;
import org.wildfly.clustering.marshalling.spi.ByteBufferMarshaller;

/**
Expand All @@ -38,10 +39,10 @@
* @author Paul Ferraro
*/
public class JavaByteBufferMarshaller implements ByteBufferMarshaller {
private final ClassResolver resolver;
private final Externalizer<ClassLoader> externalizer;

public JavaByteBufferMarshaller(ClassResolver resolver) {
this.resolver = resolver;
public JavaByteBufferMarshaller(Externalizer<ClassLoader> externalizer) {
this.externalizer = externalizer;
}

@Override
Expand All @@ -51,7 +52,7 @@ public boolean isMarshallable(Object object) {

@Override
public Object readFrom(InputStream in) throws IOException {
try (ObjectInput input = new ObjectInputStream(in, this.resolver)) {
try (ObjectInput input = new ObjectInputStream(in, this.externalizer)) {
return input.readObject();
} catch (ClassNotFoundException e) {
InvalidClassException exception = new InvalidClassException(e.getMessage());
Expand All @@ -62,7 +63,7 @@ public Object readFrom(InputStream in) throws IOException {

@Override
public void writeTo(OutputStream out, Object object) throws IOException {
try (ObjectOutput output = new ObjectOutputStream(out, this.resolver)) {
try (ObjectOutput output = new ObjectOutputStream(out, this.externalizer)) {
output.writeObject(object);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,35 @@
import java.io.ObjectStreamClass;
import java.lang.reflect.Proxy;

import org.wildfly.clustering.marshalling.Externalizer;

/**
* An {@link java.io.ObjectInputStream} that resolves classes using a given {@link ClassResolver}.
* An {@link java.io.ObjectInputStream} that resolves classes using a given {@link ClassLoaderResolver}.
* @author Paul Ferraro
*/
public class ObjectInputStream extends java.io.ObjectInputStream {

private final ClassResolver resolver;
private final Externalizer<ClassLoader> externalizer;

public ObjectInputStream(InputStream input, ClassResolver resolver) throws IOException {
public ObjectInputStream(InputStream input, Externalizer<ClassLoader> externalizer) throws IOException {
super(input);
this.resolver = resolver;
this.externalizer = externalizer;
}

@Override
protected Class<?> resolveClass(ObjectStreamClass description) throws IOException, ClassNotFoundException {
return this.resolver.resolveClass(this, description.getName());
String className = description.getName();
return this.externalizer.readObject(this).loadClass(className);
}

@Override
protected Class<?> resolveProxyClass(String[] interfaces) throws IOException, ClassNotFoundException {
Class<?>[] interfaceClasses = new Class<?>[interfaces.length];
for (int i = 0; i < interfaces.length; ++i) {
interfaceClasses[i] = this.resolver.resolveClass(this, interfaces[i]);
interfaceClasses[i] = this.externalizer.readObject(this).loadClass(interfaces[i]);
}
try {
return Proxy.getProxyClass(this.resolver.getClassLoader(), interfaceClasses);
return Proxy.getProxyClass(this.externalizer.readObject(this), interfaceClasses);
} catch (IllegalArgumentException e) {
throw new ClassNotFoundException(null, e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,31 @@
import java.io.IOException;
import java.io.OutputStream;

import org.wildfly.clustering.marshalling.Externalizer;

/**
* An {@link java.io.ObjectInputStream} that annotates classes using a given {@link ClassResolver}.
* An {@link java.io.ObjectInputStream} that annotates classes using a given {@link ClassLoaderResolver}.
* @author Paul Ferraro
*/
public class ObjectOutputStream extends java.io.ObjectOutputStream {

private final ClassResolver resolver;
private final Externalizer<ClassLoader> externalizer;

public ObjectOutputStream(OutputStream output, ClassResolver resolver) throws IOException {
public ObjectOutputStream(OutputStream output, Externalizer<ClassLoader> externalizer) throws IOException {
super(output);
this.resolver = resolver;
this.externalizer = externalizer;
}

@Override
protected void annotateClass(Class<?> targetClass) throws IOException {
this.resolver.annotateClass(this, targetClass);
this.externalizer.writeObject(this, targetClass.getClassLoader());
}

@Override
protected void annotateProxyClass(Class<?> proxyClass) throws IOException {
this.resolver.annotateClass(this, proxyClass);
for (Class<?> interfaceClass : proxyClass.getInterfaces()) {
this.externalizer.writeObject(this, interfaceClass.getClassLoader());
}
this.externalizer.writeObject(this, proxyClass.getClassLoader());
}
}
Loading

0 comments on commit 7076471

Please sign in to comment.